Re: WIP: generalized index constraints
Dean Rasheed <dean.a.rasheed@googlemail.com>
From: Dean Rasheed <dean.a.rasheed@googlemail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Jeff Davis <pgsql@j-davis.com>, Simon Riggs <simon@2ndQuadrant.com>, pgsql-hackers@postgresql.org
Date: 2009-07-08T07:48:49Z
Lists: pgsql-hackers
Tom Lane wrote: > ... I think it might be interesting to turn > around Jeff's syntax sketch and provide a way to say that a CONSTRAINT > declaration should depend on some previously added index, eg > something like > > ALTER TABLE tab ADD CONSTRAINT UNIQUE (col1, col2) USING index > Is there any reason to limit UNIQUE constraints to lists of table columns? If you can build a unique index on an expression, why not a unique constraint? A quick test defining an index and manually adding catalog entries for the constraint and depends showed that it appears to work fine (and it's compatible with my deferrable unique constraints patch :-) ) - Dean