Re: Case Insensitive CHECK CONSTRAINTs

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Shaw Terwilliger <sterwill(at)sourcegear(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Case Insensitive CHECK CONSTRAINTs
Date: 2001-03-14 19:46:18
Message-ID: Pine.BSF.4.21.0103141145420.6508-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


I'd guess that making the lower() index unique would possibly work.

On Wed, 14 Mar 2001, Shaw Terwilliger wrote:

> I have a table with a TEXT field called "username". I'd like to retain the
> case of the data stored here, but I'd like all comparisons to be done without
> regard to case. Since all these accesses _should_ be done through database
> functions, I can simply lower() the input values and compare. I also have
> an index created on lower(username), so lookups are quick.
>
> However, I'd also like to have some sort of table constraint to make sure
> alternate case "duplicate" records don't creep into the table. Any tips?

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Peter Eisentraut 2001-03-14 19:46:38 Re: Fast Inserts and Hardware Questions
Previous Message Dan Lyke 2001-03-14 19:43:18 MetaData