Re: Constraint UNIQUE on a column not case sensitive - Mailing list pgsql-sql

From Michael Glaesemann
Subject Re: Constraint UNIQUE on a column not case sensitive
Date
Msg-id 07BE168B-0F4D-417A-8EB4-E1D55F753E19@seespotcode.net
Whole thread Raw
In response to Constraint UNIQUE on a column not case sensitive  (Daniel CAUNE <d.caune@free.fr>)
Responses Re: Constraint UNIQUE on a column not case sensitive  (Daniel CAUNE <d.caune@free.fr>)
List 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





pgsql-sql by date:

Previous
From: Daniel CAUNE
Date:
Subject: Constraint UNIQUE on a column not case sensitive
Next
From: Jorge Godoy
Date:
Subject: Re: Constraint UNIQUE on a column not case sensitive