Re: case-insensitive SELECT

From: Ryan Ho <ryanho(at)pacific(dot)net(dot)sg>
To: "Giorgio A(dot)" <jh(at)libero(dot)it>, "PGSQL Novice List" <pgsql-novice(at)postgresql(dot)org>
Subject: Re: case-insensitive SELECT
Date: 2001-06-12 02:52:38
Message-ID: 5.0.2.1.0.20010612105030.00b426e0@pacific.net.sg
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

At 06:20 PM 6/11/01 +0200, Giorgio A. wrote:
>hi, i'm trieing to do a case-insensitive SELECT but i can't find a tag
>preposed to this scope.
>
>i tried to use ILIKE but i get a pg_error.... maybe it's not implemented in
>version 7.0.3 ? if so, have i any alternative way to do this
>case-insensitive SELECT ?

You're referring to text comparisons like "LIKE"?
For case insensitive comparisons I normally use the regular expression
method, which is "~*", where "*" means "to-ignore-case".

e.g.

SELECT address FROM people WHERE name ~* 'sam'

Regards
Ryan

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Giorgio A. 2001-06-12 07:53:38 Re: case-insensitive SELECT
Previous Message Johan Daine 2001-06-12 00:04:14 Re: case-insensitive SELECT