Re: 2Q: Vacuuming and making queries case insensitive

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Sean Davis" <sdavis2(at)mail(dot)nih(dot)gov>
Cc: "sdger erger" <killen(dot)nextdoor(at)gmail(dot)com>, pgsql-novice(at)postgresql(dot)org
Subject: Re: 2Q: Vacuuming and making queries case insensitive
Date: 2008-01-28 01:49:26
Message-ID: 16169.1201484966@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

"Sean Davis" <sdavis2(at)mail(dot)nih(dot)gov> writes:
> On Jan 27, 2008 8:07 PM, sdger erger <killen(dot)nextdoor(at)gmail(dot)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

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Tom Lane 2008-01-28 20:27:45 Re: 2Q: Vacuuming and making queries case insensitive
Previous Message Sean Davis 2008-01-28 01:11:49 Re: 2Q: Vacuuming and making queries case insensitive