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

From Richard Huxton
Subject Re: multi column foreign key for implicitly unique columns
Date
Msg-id 41237DA2.9090405@archonet.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  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-sql
Tom Lane wrote:
> Jan Wieck <JanWieck@Yahoo.com> writes:
> 
>>However, Bruce, this should be on the TODO list:
>>     * Allow foreign key to reference a superset of the columns
>>       covered by a unique constraint on the referenced table.
> 
> 
> See the followup discussion as to why this is a bad idea.

Maybe an alternative todo?

* 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.

--   Richard Huxton  Archonet Ltd


pgsql-sql by date:

Previous
From: Rod Taylor
Date:
Subject: Re: multi column foreign key for implicitly unique columns
Next
From: Chris Travers
Date:
Subject: Re: SQL Challenge: Arbitrary Cross-tab