How to create a case-insensitive unique constraint? - Mailing list pgsql-general

From Kynn Jones
Subject How to create a case-insensitive unique constraint?
Date
Msg-id c2350ba40809021346l1ea74657jec9cb5ebd3496c49@mail.gmail.com
Whole thread Raw
Responses Re: How to create a case-insensitive unique constraint?  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: How to create a case-insensitive unique constraint?  ("Dennis Brakhane" <brakhane@googlemail.com>)
List pgsql-general
Hi!

If I try something like

ALTER TABLE foo
  ADD CONSTRAINT foo_unique_xy
  UNIQUE ( UPPER( x ), UPPER( y ) );

...I get a syntax error

ERROR:  syntax error at or near "("
LINE 3:   UNIQUE ( UPPER( x ), UPPER( y ) );

Is there a way to do this?

TIA!

Kynn


pgsql-general by date:

Previous
From: "Scott Marlowe"
Date:
Subject: Re: Foreign Key normalization question
Next
From: Thomas Finneid
Date:
Subject: Re: plpgsql returning resultset