unique index on more than one field using functions

From: domingo(at)dad-it(dot)com (Domingo Alvarez Duarte)
To: pgsql-sql(at)postgresql(dot)org
Subject: unique index on more than one field using functions
Date: 2001-07-22 10:14:46
Message-ID: 70a76315.0107220214.2e699125@posting.google.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

I'm trying create a unique index using more than one field and
applying a function in one field to achieve case insensitive
uniqueness but postgresql doesn't accept.

create table a(

id int primary key,
id2 int not null,
name varchar(50),
unique(id2, lower(name))
);

Anyone have an idea ?

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message D'Arcy J.M. Cain 2001-07-22 12:12:19 Re: Get the tables names?
Previous Message Josh Berkus 2001-07-21 16:30:27 Re: Re: PLpgSQL