Case Insensitive Queries

From: Dan Lyke <danlyke(at)flutterby(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Case Insensitive Queries
Date: 2001-05-29 16:55:18
Message-ID: 15123.54390.703981.375120@wynand.flutterby.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Mark writes:
> Is it possible to execute a query using a where clause that allows case
> insensitive comparison between a field and text.

select * from account where upper(username) = upper('test')

(Upper used because, as has been remarked on this list and in other places,
folding from richer character sets is likely to get better matches this way).

And yes, you can create an index on upper(fieldname).

Dan

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Jim Ballard 2001-05-29 18:54:03 Re: Case Insensitive Queries
Previous Message Joe Conway 2001-05-29 16:54:39 Re: Case Insensitive Queries