Case Insensitive CHECK CONSTRAINTs

From: Shaw Terwilliger <sterwill(at)sourcegear(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Case Insensitive CHECK CONSTRAINTs
Date: 2001-03-14 18:59:18
Message-ID: 20010314125918.D17868@lister.sourcegear.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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?

--
Shaw Terwilliger <sterwill(at)sourcegear(dot)com>
SourceGear Corporation
217.356.0105 x 641

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Orion Henry 2001-03-14 19:08:48 Fast Inserts and Hardware Questions
Previous Message Tim Frank 2001-03-14 18:42:06 Re: pg_hba.conf "sameuser"