Re: why don't string function work in WHERE clause?

From: Dennis Gearon <gearond(at)cvc(dot)net>
To: Dragan Matic <gekko(at)eunet(dot)yu>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: why don't string function work in WHERE clause?
Date: 2003-04-30 22:59:39
Message-ID: 3EB0555B.4080508@cvc.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

try
select column1 from table1 where trim( lower(column1) ) = 'some_string'

As someone in the archives has said, char is evil. And varchar is your friend.

Dragan Matic wrote:
> Here's a sample:
>
> select column1 from table1 where lower(column1) = 'some_string'
>
> will not give me any results although column1 (defined as char[50]) has
> values like
> 'Some_string' or 'SOME_STRING'
>
> if for instance I say something like:
>
> select lower(column1) from table1 where column1 = 'SOME_STRING'
>
> then it returns 'some_string' correctly. The same thing happens with
> 'upper' and similar functions. Why don't they work when they are in
> WHERE clause?
>
> Dragan Matic
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Peter Darley 2003-04-30 23:41:45 Re: Problem with || and data types
Previous Message Dragan Matic 2003-04-30 22:26:33 why don't string function work in WHERE clause?