Re: [BUGS] Equal test on strings doesn't ignore trailing spaces if the function 'lower' is applied

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Alain TESIO" <tesio(at)easynet(dot)fr>
Cc: "PGSQL Bugs" <pgsql-bugs(at)postgreSQL(dot)org>
Subject: Re: [BUGS] Equal test on strings doesn't ignore trailing spaces if the function 'lower' is applied
Date: 1999-12-27 16:00:38
Message-ID: 26225.946310438@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

"Alain TESIO" <tesio(at)easynet(dot)fr> writes:
> I have to apply rtrim explicitely if the string to
> compare has been converted to lowercase :

lower() is a text function, not a fixed-length-char function,
so the result of lower() is assumed to have significant trailing
blanks. It's not clear to me that the behavior you're complaining
about is a bug.

I'd suggest using varchar or text if you are dealing with strings
that are actually variable-length.

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tomas Cerha 1999-12-28 20:09:15 INET operators and NOT
Previous Message Tom Lane 1999-12-27 15:52:43 Re: [BUGS] Always one row with group by / agregate