Re: bug/feature with upper function?

From: Vincent Stoessel <vincent(at)xaymaca(dot)com>
To: Vincent Stoessel <vincent(at)xaymaca(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: bug/feature with upper function?
Date: 2002-03-20 20:51:25
Message-ID: 3C98F64D.9020501@xaymaca.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Thanks to everyone that replied. I am adjusted my queries and tables
accordingly. You must admit that the answer was a little non-intuitive.

Vincent Stoessel wrote:
> Hello All,
>
> I am having a serious problem matching text using the upper() function
> in postgres 7.2 (from developer rpms) on Redhat 7.2
>
>
> How to replicate:
>
> 1. create a table of one column character(20)
> 2.insert words with all uppercase letters.
> 3. Try matching the word with "select * from table where
> upper(columnname) = 'word'"
>
> I get a result of zero every time.
>
>
>
> db=# SELECT * from upp_test ;
> uname
> ----------------------
> KAT
> KAT
> KAT
> KAT
> KAT
> (5 rows)
>
>
>
> FEC=# SELECT * from upp_test where uname = 'KAT' ;
> uname
> ----------------------
> KAT
> KAT
> KAT
> KAT
> KAT
> (5 rows)
>
> db=# SELECT * from upp_test where upper(uname) = 'KAT' ;
> uname
> -------
> (0 rows)
>
> The reason I am worried about this is that I have a mix of upper and
> lower case words in the real world coumn and I have not been getting
> complete matches. Is this a bug?
>
> Vincent
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2002-03-20 20:52:56 Re: dbase restore
Previous Message Vincent Stoessel 2002-03-20 20:48:48 Re: zerofill: lost my leading zeroes