Re: [HACKERS] lower() broken?

From: "Thomas G(dot) Lockhart" <lockhart(at)alumni(dot)caltech(dot)edu>
To: Vince Vielhaber <vev(at)michvhf(dot)com>
Cc: hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] lower() broken?
Date: 1999-02-20 06:17:05
Message-ID: 36CE5361.5BDF621E@alumni.caltech.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> > Vince> Oops! Yeah, I guess lower wouldn't work so well if it was
> > Vince> a numeric field. Anyway, username is a char(8).
> > It won't be equal to 'joblo', it will be equal to 'joblo '. You
> > may want to consider using varchar(8).
> Damn. That's the one thing that never even occurred to me!

I don't remember what my old Ingres system did for comparisons of char
against other string types; does every system (or the SQL standard)
consider the trailing blanks significant, or should they be implicitly
ignored in comparisons?

btw, if you don't want to redefine the column, then try

where trim(trailing from username) = lower('joblo');

but that will be a slower query since "username" must be trimmed before
comparison.

- Tom

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Hannu Krosing 1999-02-20 12:39:44 Re: [HACKERS] Re: [SQL] SQL-Query 2 get primary key
Previous Message Vince Vielhaber 1999-02-20 05:02:08 Re: [HACKERS] lower() broken?