For a situation like this I have always used the upper() function :

SELECT
        *
FROM
        table_name
WHERE
        upper( last_name ) = 'DEFELICE';

This way, regardless of what is stored in the last_name field, it is forced
to upper before the comparison (it doesn't later what is actually in the
field, so it's safe that way).

I'm not positive, but I believe this is more efficient than RegEx.  The nice
thing about RegEx is it is generic and has many purposes.  The bad thing
about RegEx is that *BECAUSE* it is generic, it does none of those things
particularly efficiently.

Good Luck!!
______________________________________________
John Pagakis - [EMAIL PROTECTED]
DevelopOnline.com
(480)377-6828


"Not everyone is going to like what I do, and
 that's something I can accept; if everyone liked 
 what I did, I probably wouldn't be playing 
 anything of depth."
        -- Joshua Redman

This signature generated by the shareware version of
     ... and I Quote!! Copyright (C) 1999 SpaZmodic Frog Software, Inc.
-----Original Message-----
From: Oliver Vecernik [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 04, 2001 2:49 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: [ADMIN] Queries


[EMAIL PROTECTED] wrote:
> 
> Greetings All.
> 
> I have a record on my database with a last name of 'DeFelice'.
> 
> I want to be able to retrieve that record whether a user enters
'DeFelice', 'Defelice', 'defelice', or 'DEFELICE'.  Is there a way I can do
that?  Is that what the "ilike" function does?
> 
> I'm on 7.0.3.

~* Match (regex), case insensitive is what you are looking for.

Regards,
Oliver

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to [EMAIL PROTECTED] so that your
message can get through to the mailing list cleanly

John Pagakis.vcf

John Pagakis.vcf


---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://www.postgresql.org/search.mpl

Reply via email to