Re: WIP: generalized index constraints

From: Dean Rasheed <dean(dot)a(dot)rasheed(at)googlemail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Jeff Davis <pgsql(at)j-davis(dot)com>, Simon Riggs <simon(at)2ndQuadrant(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: WIP: generalized index constraints
Date: 2009-07-08 07:48:49
Message-ID: 4A544F61.5020305@googlemail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Dimitri Fontaine 2009-07-08 08:06:08 Re: Re: Synch Rep: direct transfer of WAL file from the primary to the standby
Previous Message Dean Rasheed 2009-07-08 07:37:12 Re: WIP: Deferrable unique constraints