Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search archives
  Advanced Search

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: Sun, 27 Jan 2008 20:49:26 -0500
  • Message-id: <16169.1201484966@sss.pgh.pa.us> <text/plain>

"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



Home | Main Index | Thread Index

Privacy Policy | About PostgreSQL
Copyright © 1996 – 2012 PostgreSQL Global Development Group