Case insensitive select

From: "isaac flemmin" <isaac(at)knox(dot)net>
To: <pgsql-sql(at)postgresql(dot)org>
Subject: Case insensitive select
Date: 2002-06-13 00:43:39
Message-ID: 000001c21273$5cc3f3c0$ad463e04@ixic
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hello,

I am using PostgreSQL 7.2 and I am trying to do a case insensitive
select statement using the lower function. I am using these lines from
the PostgreSQL 7.2 users guide as a template for my query.

--
"For example, a common way to do case-insensitive comparisons is to use
the lower function:
SELECT * FROM test1 WHERE lower(col1) = 'value';"
--

The query looks almost exactly the same but it always returns 0 results.
This does not make sense to me because if the query,

"SELECT * FROM test1 WHERE col1 = 'Value';",

returns something, then I assume the query,

"SELECT * FROM test1 WHERE lower(col1) = 'value';",

should return something as well. Do I not understand the way that the
lower function works, or is there something else I have to do? Obviously
I am doing something wrong or it would be working. I really have no idea
how to do a case insensitive query other than with the lower function.
If there is anyone out there who has any ideas on how to help me or can
point me toward something that will help me it would be very
appreciated.

Thanks
Isaac
--

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Josh Berkus 2002-06-13 01:08:19 Re: Case insensitive select
Previous Message Beth Gatewood 2002-06-12 23:44:20 Re: make a unique index for foreign keys?