Re: Use of !~* to keep a varchar column UNIQUE case-insensitive

From: "Don Morrison" <donmorrison(at)gmail(dot)com>
To: "Sean Davis" <sdavis2(at)mail(dot)nih(dot)gov>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Use of !~* to keep a varchar column UNIQUE case-insensitive
Date: 2006-08-18 16:49:06
Message-ID: aee6519f0608180949t61d7590fwab5eb81a54d36ffb@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

> You can define your index to be unique on a function of the column. As an
> example:
>
> create table testtable (
> name varchar(40) not NULL
> );
> create unique index my_case_insensitive_index on testtable(lower(name));

That'll work, thanks Sean!

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Don Morrison 2006-08-18 17:52:28 Re: Use of !~* to keep a varchar column UNIQUE case-insensitive
Previous Message Tom Lane 2006-08-18 16:48:03 Re: Use of !~* to keep a varchar column UNIQUE case-insensitive