Re: [SQL] Searching Text Fields - Case Sensitive?

From: "Moray McConnachie" <moray(dot)mcconnachie(at)computing-services(dot)oxford(dot)ac(dot)uk>
To: <pgsql-sql(at)postgresql(dot)org>
Subject: Re: [SQL] Searching Text Fields - Case Sensitive?
Date: 1999-08-13 07:48:06
Message-ID: 002801bee560$2e499d30$760e01a3@oucs.ox.ac.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


----- Original Message -----
From: Bart Ogryczak <bart(at)bart(dot)w-wa(dot)pl>
To: <pgsql-sql(at)postgreSQL(dot)org>
Sent: Thursday, August 12, 1999 4:24 PM
Subject: Re: [SQL] Searching Text Fields - Case Sensitive?

> > SELECT * FROM mydb WHERE description LIKE "%foobar%";
> > it seems to be case sensitive. Is there a way to do it so it is NOT
> > case-sensitive?
> SELECT * FROM mydb WHERE lower(description) LIKE "%foobar%";

Brings up an interesting question. Which is faster, to use the lower/upper
functions as above (and of course
if foobar is a variable, it would also have to be made lower case by the
program calling pgsql), or to use the pattern matching case-insensitive
operator?

Yours,
Moray

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Bart Ogryczak 1999-08-13 09:07:18 Re: [SQL] Searching Text Fields - Case Sensitive?
Previous Message Tom Lane 1999-08-12 23:01:56 Re: [SQL] Select Maximum Question