RE: [GENERAL] Strange behaviour ?

Поиск
Список
Период
Сортировка
От Jackson, DeJuan
Тема RE: [GENERAL] Strange behaviour ?
Дата
Msg-id F10BB1FAF801D111829B0060971D839F36835A@cpsmail
обсуждение исходный текст
Список pgsql-general
> > look up the differences between varchar and char data types.
>
> I know the difference between varchar and char, but I don't see why
> LOWER() is
> adding spaces. If this is the correct behaviour, could you kindly
> point me to
> the related docs ?
>
The LOWER() function is not adding the spaces; the char() datatype is
adding the spaces.  The "char = text" compare operator ignores the
spaces at the end of the char type.  But when you use the lower function
the type is returned as varchar() including the spaces, and the "varchar
= text" operator doesn't ignore the spaces.  Try either changing the
type to varchar which won't add the spaces to the end, or using
"LOWER(TRIM(char)) = text".

> Thanks.
>
> Bye!
>
> --
>  Daniele
>
> ----------------------------------------------------------------------
> ---------
> "On the Internet, no one knows you're using Windows NT"
> (Submitted by Ramiro Estrugo, restrugo@fateware.com)
> ----------------------------------------------------------------------
> ---------
>  Se telecom italia aggiungesse uno scatto al giorno ad ogni abbonato,
> dal
>  primo Gennaio avrebbe rubato 669.032.000.000 Lire.
> ----------------------------------------------------------------------
> ---------
>  Daniele Orlandi - Utility Line Italia - http://www.orlandi.com
>  Via Mezzera 29/A - 20030 - Seveso (MI) - Italy
> ----------------------------------------------------------------------
> ---------

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

Предыдущее
От: Daniele Orlandi
Дата:
Сообщение: Re: [GENERAL] Strange behaviour ?
Следующее
От: Maarten Boekhold
Дата:
Сообщение: Re: [GENERAL] User authentication blues