Skip site navigation (1) Skip section navigation (2)

Re: [GENERAL] interesting PHP/MySQL thread

From: Sean Chittenden <sean(at)chittenden(dot)org>
To: nolan(at)celery(dot)tssi(dot)com
Cc: Advocacy PostgreSQL <pgsql-advocacy(at)postgresql(dot)org>,PostgreSQL-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: [GENERAL] interesting PHP/MySQL thread
Date: 2003-06-23 05:44:45
Message-ID: 20030623054445.GT97131@perrin.int.nxad.com (view raw or flat)
Thread:
Lists: pgsql-advocacypgsql-docspgsql-general
[ Please stop cross posting emails between mailing lists! ]

> > > Personally, if I want case insensitivity, I'll WRITE IT INTO THE CODE,
> > > but I can see how some people might think that 'NOLAN', 'Nolan' and
> > > 'nolan' should be considered as the same data.
> > 
> > Oh, you mean like "SELECT * FROM table WHERE field ~* 'nolan';"?
> 
> No, I mean as in "SELECT * FROM table WHERE field = 'nolan';"

CREATE INDEX table_field_lower_idx ON table (LOWER(field));
VACUUM ANALYZE table;
SELECT * FROM table WHERE LOWER(field) = LOWER('nolan');
SELECT * FROM table WHERE field ILIKE 'nolan%';


ILIKE is case insensitive LIKE.

http://developer.postgresql.org/docs/postgres/functions-matching.html#FUNCTIONS-LIKE

This is likely an FAQ for new MySQL users at this point, or should be
if it's not.

If you are still having performance problems with the above solutions,
please send an EXPLAIN ANALYZE to the performance@ list so we can
figure out what's going on.  -sc

-- 
Sean Chittenden

In response to

pgsql-docs by date

Next:From: Christopher Kings-LynneDate: 2003-06-23 05:54:07
Subject: Re: [GENERAL] interesting PHP/MySQL thread
Previous:From: nolanDate: 2003-06-23 05:33:51
Subject: Re: [GENERAL] interesting PHP/MySQL thread

pgsql-advocacy by date

Next:From: Christopher Kings-LynneDate: 2003-06-23 05:54:07
Subject: Re: [GENERAL] interesting PHP/MySQL thread
Previous:From: nolanDate: 2003-06-23 05:33:51
Subject: Re: [GENERAL] interesting PHP/MySQL thread

pgsql-general by date

Next:From: Christopher Kings-LynneDate: 2003-06-23 05:54:07
Subject: Re: [GENERAL] interesting PHP/MySQL thread
Previous:From: nolanDate: 2003-06-23 05:33:51
Subject: Re: [GENERAL] interesting PHP/MySQL thread

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group