Re: 2Q: Vacuuming and making queries case insensitive - Mailing list pgsql-novice

From Tom Lane
Subject Re: 2Q: Vacuuming and making queries case insensitive
Date
Msg-id 16169.1201484966@sss.pgh.pa.us
Whole thread Raw
In response to Re: 2Q: Vacuuming and making queries case insensitive  ("Sean Davis" <sdavis2@mail.nih.gov>)
List pgsql-novice
"Sean Davis" <sdavis2@mail.nih.gov> writes:
> On Jan 27, 2008 8:07 PM, sdger erger <killen.nextdoor@gmail.com> wrote:
>> I also wonder if it is possible to make command line searches case
>> insensitive? Like when I write WHERE name='PHIL' I want it to be the same as
>> WHERE name='phil'.

> where name ilike 'phil'.

Probably better: WHERE lower(name) = lower('PHIL')
since this has some chance of using an index (you'd need an index on
lower(name)).  ILIKE is basically dead in the water for indexing.

If you're desperate not to change your queries that way, look for citext
on pgfoundry.

            regards, tom lane

pgsql-novice by date:

Previous
From: "Sean Davis"
Date:
Subject: Re: 2Q: Vacuuming and making queries case insensitive
Next
From: Decibel!
Date:
Subject: Re: populating arrays with default values