Re: Error in SELECT clause with UPPER function

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: prempenault(at)hubwoo(dot)com
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Error in SELECT clause with UPPER function
Date: 2002-11-15 22:18:40
Message-ID: 2272.1037398720@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Pascal Rempenault" <prempenault(at)hubwoo(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Stephan Szabo 2002-11-15 23:38:46 Re: RI_FKey_check: foreign key constraint blocks parallel
Previous Message Tom Lane 2002-11-15 22:14:12 Re: manipuliation the pg_shadow table