RE: [GENERAL] Strange behaviour ?

From: "Jackson, DeJuan" <djackson(at)cpsgroup(dot)com>
To: Daniele Orlandi <daniele(at)orlandi(dot)com>, James Boorn <boorn(at)acsys(dot)com>
Cc: pgsql-general(at)postgreSQL(dot)org
Subject: RE: [GENERAL] Strange behaviour ?
Date: 1998-07-30 18:00:11
Message-ID: F10BB1FAF801D111829B0060971D839F36835A@cpsmail
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)fateware(dot)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
> ----------------------------------------------------------------------
> ---------

Browse pgsql-general by date

  From Date Subject
Next Message Maarten Boekhold 1998-07-30 18:28:13 Re: [GENERAL] User authentication blues
Previous Message Daniele Orlandi 1998-07-30 16:21:19 Re: [GENERAL] Strange behaviour ?