Re: [INTERFACES] Case insensitive LIKE ? - Mailing list pgsql-interfaces

From Hannu Krosing
Subject Re: [INTERFACES] Case insensitive LIKE ?
Date
Msg-id 381C3C08.DF980E4@tm.ee
Whole thread Raw
In response to Case insensitive LIKE ?  (Constantin Teodorescu <teo@flex.ro>)
List pgsql-interfaces
Constantin Teodorescu wrote:
> 
> Hannu Krosing wrote:
> >
> > Constantin Teodorescu wrote:
> > >
> > > Is there for PostgreSQL a modifier(parameter) that will make the LIKE
> > > clause case insensitive ?
> >
> > Maybe
> >
> >  select * from t where lower(name) like 'john%';
> 
> Yes, it may work, but probably lower(name) won't work on ODBC->MS Access
> ...

It is much more likely to work than ~* , the case-insensitive regex op.

But to make it use indexes (for the exact case above) you should also create 
index on lower(name).

> I would like to preserve also the SQL commands betwen versions and not
> to fill my program with IF's ..

I doubt that case-insensitive like is in any standard.

Could someone look it up in SQL92 spec ?

------------
Hannu


pgsql-interfaces by date:

Previous
From: Constantin Teodorescu
Date:
Subject: Re: [INTERFACES] Case insensitive LIKE ?
Next
From: "D'Arcy" "J.M." Cain
Date:
Subject: Re: [INTERFACES] Case insensitive LIKE ?