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

From: "Don Morrison" <donmorrison(at)gmail(dot)com>
To: "Daniel T(dot) Staal" <DStaal(at)usa(dot)net>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Use of !~* to keep a varchar column UNIQUE
Date: 2006-08-18 20:30:19
Message-ID: aee6519f0608181330j41d75365m223abcb49e95a35@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On 8/18/06, Daniel T. Staal <DStaal(at)usa(dot)net> wrote:
> On Fri, August 18, 2006 1:52 pm, Don Morrison said:
>
> > The above works well enough, and I can live with it, but it is not
> > comprehensive...it would be nice to use a regular expression....and do
> > something like:
>
> The other way of doing this, depending on your data integrety needs, would
> be to use a before trigger on insert, which could trim the space and
> convert to some normalized case. PL/Perl would be a good language for
> this. ;)

Thanks for the idea Dan; I can't normalize the case in this instance
unfortunately, because the term being entered may or may not contain
an acronym. Thanks for the attempt though, I really appreciate the
positive response I've received from the pgsql-novice list. :)

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Don Morrison 2006-08-18 20:32:55 Re: Use of !~* to keep a varchar column UNIQUE case-insensitive
Previous Message Tom Lane 2006-08-18 20:04:04 Re: Use of !~* to keep a varchar column UNIQUE case-insensitive