Re: Error in SELECT clause with UPPER function - Mailing list pgsql-general

From Tom Lane
Subject Re: Error in SELECT clause with UPPER function
Date
Msg-id 2272.1037398720@sss.pgh.pa.us
Whole thread Raw
In response to Error in SELECT clause with UPPER function  ("Pascal Rempenault" <prempenault@hubwoo.com>)
List pgsql-general
"Pascal Rempenault" <prempenault@hubwoo.com> writes:
> track=# select loginname, upper(loginname) from tperson where
> upper(loginname)='ADMIN';
>  loginname | upper
> -----------+-------
> (0 rows)

I'm guessing that there are trailing blanks in loginname (possibly
because it's declared char(n) rather than varchar(n)).  The result
of upper() is always of type text, so comparison to it treats the
trailing blanks as significant.

            regards, tom lane

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: manipuliation the pg_shadow table
Next
From: Stephan Szabo
Date:
Subject: Fwd: [HACKERS] RI_FKey_check: foreign key constraint blocks parallel