pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Scott Marlowe <smarlowe@g2switchworks.com>
To: lorid <lorid@dri.edu>
Cc: pgsql-admin@postgresql.org
Subject: Re: how to ignore case
Date: Thu, 19 May 2005 14:20:16 -0500
Message-ID: <1116530416.31821.103.camel@state.g2switchworks.com> (raw)
In-Reply-To: <428CE06C.9060604@dri.edu>
References: <428CE06C.9060604@dri.edu>

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



view thread (4+ messages)  latest in thread

Message-ID: <1116530416.31821.103.camel@state.g2switchworks.com>
Permalink:  ../1116530416.31821.103.camel@state.g2switchworks.com/
Also on:    postgresql.org/message-id/1116530416.31821.103.camel@state.g2switchworks.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: smarlowe@g2switchworks.com, lorid@dri.edu
  Subject: Re: how to ignore case
  In-Reply-To: <1116530416.31821.103.camel@state.g2switchworks.com>
  References: <428CE06C.9060604@dri.edu> <1116530416.31821.103.camel@state.g2switchworks.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox