Re: How to create a case-insensitive unique constraint?

From: "Dennis Brakhane" <brakhane(at)googlemail(dot)com>
To: "Kynn Jones" <kynnjo(at)gmail(dot)com>
Cc: "pgsql-general General" <pgsql-general(at)postgresql(dot)org>
Subject: Re: How to create a case-insensitive unique constraint?
Date: 2008-09-02 21:24:43
Message-ID: 226a19190809021424y1d4dce80gcd17e750c29b3cc2@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

You can use a unique index:

CREATE UNIQUE INDEX idx_foo_unique_upper_x_upper_y ON foo
(UPPER(x), UPPER(y));

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Roberts, Jon 2008-09-02 21:27:31 Re: plpgsql returning resultset
Previous Message Asko Oja 2008-09-02 21:21:12 Re: Oracle and Postgresql