Re: Constraint UNIQUE on a column not case sensitive

From: Michael Glaesemann <grzm(at)seespotcode(dot)net>
To: Daniel CAUNE <d(dot)caune(at)free(dot)fr>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Constraint UNIQUE on a column not case sensitive
Date: 2006-07-01 14:01:08
Message-ID: 07BE168B-0F4D-417A-8EB4-E1D55F753E19@seespotcode.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


On Jul 1, 2006, at 22:47 , Daniel CAUNE wrote:

> The idea is to have an index on that column, in a not case
> sensitive form, i.e. lower(MyColumn).

I think you're really close. Try

CREATE UNIQUE INDEX ci_mycolumn_idx ON mytable(lower(mycolumn));

Does that do what you're looking for?

Michael Glaesemann
grzm seespotcode net

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Jorge Godoy 2006-07-01 14:04:13 Re: Constraint UNIQUE on a column not case sensitive
Previous Message Daniel CAUNE 2006-07-01 13:47:59 Constraint UNIQUE on a column not case sensitive