small bug in ADD CONSTRAINT
small bug in ADD CONSTRAINT
От:
Joseph Shraibman <jks@selectacast.net>
Дата:
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 had to create a unique index.
Re: small bug in ADD CONSTRAINT
От:
Stephan Szabo <sszabo@megazone.bigpanda.com>
Дата:
On Wed, 10 Mar 2004, Joseph Shraibman wrote: > 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 had to create a unique index. I don't think this is a bug since it means that we properly accept a column name list in the unique constraint as per at least SQL92.
Re: small bug in ADD CONSTRAINT
От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
Joseph Shraibman 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