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

From Andrus
Subject How to create case insensitive unique constraint
Date
Msg-id dgs1hn$lco$1@news.hub.org
Whole thread Raw
Responses Re: How to create case insensitive unique constraint
Re: How to create case insensitive unique constraint
List pgsql-general
I want to disable dupplicate customer names in a database regardless to
case.

I tried

CREATE TABLE customer ( id SERIAL, name CHARACTER(70));

ALTER TABLE customer
   ADD constraint customer_name_unique UNIQUE (UPPER(name));

but this is not allowed in Postgres

Any idea ?

Andrus.



pgsql-general by date:

Previous
From: "Jeanne Thibeault"
Date:
Subject: connecting windows xp to remote server
Next
From: Csaba Nagy
Date:
Subject: Re: How to create case insensitive unique constraint