Re: unique index doesn't accept functions on fields

From: Alessio Bragadini <alessio(at)albourne(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: unique index doesn't accept functions on fields
Date: 2001-07-23 08:04:09
Message-ID: 3B5BDA79.42D9E9A6@albourne.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Domingo Alvarez Duarte wrote:

> 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))
> );

Have you tried to just CREATE TABLE and later CREATE INDEX UNIQUE
USING... ?

--
Alessio F. Bragadini alessio(at)albourne(dot)com
APL Financial Services http://village.albourne.com
Nicosia, Cyprus phone: +357-2-755750

"It is more complicated than you think"
-- The Eighth Networking Truth from RFC 1925

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2001-07-23 09:56:17 Re: Improving pg_hba.conf
Previous Message Alessio Bragadini 2001-07-23 07:47:51 Re: Neutral Soil (OT)