Re: small bug in ADD CONSTRAINT - Mailing list pgsql-bugs

From Tom Lane
Subject Re: small bug in ADD CONSTRAINT
Date
Msg-id 1485.1079208356@sss.pgh.pa.us
Whole thread Raw
In response to small bug in ADD CONSTRAINT  (Joseph Shraibman <jks@selectacast.net>)
List pgsql-bugs
Joseph Shraibman <jks@selectacast.net> writes:
> This works:
>   ALTER TABLE segment ADD CONSTRAINT  name  unique(textfield, reseller);

> This doesn't:
>   ALTER TABLE segment ADD CONSTRAINT  name  unique(lower(textfield),
> reseller);

I don't think this is a bug.  The unique-constraint syntax is defined by
the SQL spec and it only allows simple column names.  If we extended it
as you suggest, we would break code that expects constraints to apply to
columns (there is some in the backend as well as in clients).

            regards, tom lane

pgsql-bugs by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: small bug in ADD CONSTRAINT
Next
From: "PostgreSQL Bugs List"
Date:
Subject: BUG #1101: install-error