Skip site navigation (1) Skip section navigation (2)

Re: multi column foreign key for implicitly unique columns

From: Jan Wieck <JanWieck(at)Yahoo(dot)com>
To: Markus Bertheau <twanger(at)bluetwanger(dot)de>
Cc: Josh Berkus <josh(at)agliodbs(dot)com>, olly(at)lfix(dot)co(dot)uk,pgsql-sql(at)postgresql(dot)org, Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Subject: Re: multi column foreign key for implicitly unique columns
Date: 2004-08-18 14:06:47
Message-ID: 41236277.5060903@Yahoo.com (view raw or flat)
Thread:
Lists: pgsql-sql
On 8/18/2004 9:49 AM, Markus Bertheau wrote:

> В Срд, 18.08.2004, в 15:33, Jan Wieck пишет:
> 
>> Meaning that not enforcing the uniqueness of those columns isn't an 
>> option.
> 
> The thing is that the columns _are_ unique, there's just no unique
> constraint on them. They are unique because there's a unique constraint
> on a subset of these columns. So no additional uniqueness enforcing
> needed.
> 

Yes, you are right, a superset of columns of a unique constraint is 
allways unique as well.

I assume it is performance why you are denormalizing your data?



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.


Jan

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

In response to

Responses

pgsql-sql by date

Next:From: Markus BertheauDate: 2004-08-18 14:28:49
Subject: Re: multi column foreign key for implicitly unique columns
Previous:From: Markus BertheauDate: 2004-08-18 13:49:21
Subject: Re: multi column foreign key for implicitly unique columns

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group