Re: how to ignore case

From: Scott Marlowe <smarlowe(at)g2switchworks(dot)com>
To: lorid <lorid(at)dri(dot)edu>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: how to ignore case
Date: 2005-05-19 19:20:16
Message-ID: 1116530416.31821.103.camel@state.g2switchworks.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Thu, 2005-05-19 at 13:52, lorid wrote:
> How can I do a simple select statement ignoring the case ? kinda like \i
> in reg expressions ?
>
> thanks in advance

You can use upper/lower:

select * from table where lower(somefield) like '%abc%';

or REGEX:

select * from table where lower ~* '.*abc.*';

SEe:

http://www.postgresql.org/docs/8.0/static/functions-matching.html#FUNCTIONS-POSIX-TABLE

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Scott Marlowe 2005-05-19 19:30:53 Re: how to ignore case
Previous Message Jason Minion 2005-05-19 19:06:08 Re: Can you generate SQL by using SQL in Postgres?