RE: Queries

From: John Pagakis <John(dot)Pagakis(at)DevelopOnline(dot)com>
To: tsattler(at)speakeasy(dot)net
Cc: pgsql-admin(at)postgresql(dot)org
Subject: RE: Queries
Date: 2001-05-04 23:56:40
Message-ID: A04BDD2C264AD41181C000508BDCB72A71A094@usazdolexch0.developonline.home
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

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 - john(dot)pagakis(at)developonline(dot)com
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:vecernik(at)aon(dot)at]
Sent: Friday, May 04, 2001 2:49 PM
To: tsattler(at)speakeasy(dot)net
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: [ADMIN] Queries

tsattler(at)speakeasy(dot)net 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 majordomo(at)postgresql(dot)org so that your
message can get through to the mailing list cleanly

Attachment Content-Type Size
John Pagakis.vcf application/octet-stream 444 bytes
John Pagakis.vcf application/octet-stream 444 bytes

Browse pgsql-admin by date

  From Date Subject
Next Message Christian Marschalek 2001-05-05 13:15:15 RE: [ADMIN] Primary Keys
Previous Message Michael Davis 2001-05-04 23:55:55 RE: URGENT HELP NEEDED