Re: multi column foreign key for implicitly unique columns - Mailing list pgsql-sql

From Jan Wieck
Subject Re: multi column foreign key for implicitly unique columns
Date
Msg-id 4123837C.30408@Yahoo.com
Whole thread Raw
In response to Re: multi column foreign key for implicitly unique columns  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: multi column foreign key for implicitly unique columns  (Rod Taylor <pg@rbt.ca>)
Re: multi column foreign key for implicitly unique columns  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-sql
On 8/18/2004 12:18 PM, Tom Lane wrote:

> Richard Huxton <dev@archonet.com> writes:
>> * Allow multiple unique constraints to share an index where one is a 
>> superset of the others' columns.
> 
>> That way you can mark it unique without having the overhead of multiple 
>> indexes.
> 
> That just moves the uncertain-dependency problem over one spot, ie, it's
> the fabricated unique constraint that you can't pin down the
> requirements for.

If we allow for a unique index, that
    * it is NOT maintained (no index tuples in there)    * depends on another index that has a subset of columns    *
ifthat subset-index is dropped, the index becomes maintained
 

then the uncertainty is gone. At the time someone drops the other 
constraint or unique index, the data is unique with respect to the 
superset of columns. So building the unique index data at that time will 
succeed.


Jan

-- 
#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#================================================== JanWieck@Yahoo.com #


pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: multi column foreign key for implicitly unique columns
Next
From: Rod Taylor
Date:
Subject: Re: multi column foreign key for implicitly unique columns