Re: WIP: generalized index constraints - Mailing list pgsql-hackers

From Dean Rasheed
Subject Re: WIP: generalized index constraints
Date
Msg-id 4A544F61.5020305@googlemail.com
Whole thread Raw
In response to Re: WIP: generalized index constraints  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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



pgsql-hackers by date:

Previous
From: Dean Rasheed
Date:
Subject: Re: WIP: Deferrable unique constraints
Next
From: Dimitri Fontaine
Date:
Subject: Re: Re: Synch Rep: direct transfer of WAL file from the primary to the standby