Re: Case insensitive unique constraint - Mailing list pgsql-general

From Vivek Khera
Subject Re: Case insensitive unique constraint
Date
Msg-id CCEE10D2-1332-45C7-B6F0-642F1EFDFE6C@khera.org
Whole thread Raw
In response to Case insensitive unique constraint  (Rob Brenart <postgresql@oculardata.com>)
List pgsql-general
On Jul 14, 2005, at 3:14 AM, Rob Brenart wrote:

> I have a simple table to store account names... I want each name to
> be unique in a case insensitive manner... but I want the case the
> user enters to be remembered so I can't do a simple lower() on the
> data's way in.
>
> Is there an easy way to go about this? Am I about to write my first
> server side function for postgresql?

create your unique index using the lower() function.

and don't steal threads to start a new one (ie, replying then just
changing the subject)

Vivek Khera, Ph.D.
+1-301-869-4449 x806



pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: How to create unique constraint on NULL columns
Next
From: "Dinesh Pandey"
Date:
Subject: Postgres for Fedora Core 2 OS ****************