Re: [HACKERS] lower() broken?

Поиск
Список
Период
Сортировка
От Thomas G. Lockhart
Тема Re: [HACKERS] lower() broken?
Дата
Msg-id 36CE5361.5BDF621E@alumni.caltech.edu
обсуждение исходный текст
Ответ на Re: [HACKERS] lower() broken?  (Vince Vielhaber <vev@michvhf.com>)
Список 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


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Vince Vielhaber
Дата:
Сообщение: Re: [HACKERS] lower() broken?
Следующее
От: Hannu Krosing
Дата:
Сообщение: Re: [HACKERS] Re: [SQL] SQL-Query 2 get primary key