Case insensitive unique constraint

From: Michael Rowan <michael(dot)rowan3(at)gmail(dot)com>
To: pgsql-novice novice <pgsql-novice(at)postgresql(dot)org>
Subject: Case insensitive unique constraint
Date: 2014-04-09 21:51:22
Message-ID: CAL04MkkBW=u+GuqWB4K_GUZLn9YF18GCkv4_tp0Khb5SXSMuWw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

HI

I would like to do this:
ALTER TABLE a ADD CONSTRAINT a_unique UNIQUE lower(name)

This fails, syntax error near "lower"

This succeeds:
ALTER TABLE a ADD CONSTRAINT a_unique UNIQUE name

Can I get what I want, and if so, how? Many thanks.

Mike

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Tom Lane 2014-04-09 22:00:13 Re: Case insensitive unique constraint
Previous Message James David Smith 2014-04-04 14:07:03 Using indexes to speed up join?