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

Re: multi column foreign key for implicitly unique columns

From: Oliver Elphick <olly(at)lfix(dot)co(dot)uk>
To: Josh Berkus <josh(at)agliodbs(dot)com>
Cc: Jan Wieck <JanWieck(at)Yahoo(dot)com>, pgsql-sql(at)postgresql(dot)org
Subject: Re: multi column foreign key for implicitly unique columns
Date: 2004-08-19 16:52:46
Message-ID: 1092934366.19834.88.camel@braydb (view raw or flat)
Thread:
Lists: pgsql-sql
On Thu, 2004-08-19 at 17:21, Josh Berkus wrote:
> Jan,
> 
> > Because the value in b.y is redundant. b.x->a.x->a.y is exactly the same
> >   value and he even wants to ensure this with the constraint.
> 
> And in the absence of that constraint, what ensures that b.y = a.y, exactly?

In the absence of b.y, it would be impossible for it to be anything
else.  Isn't that the point?

It seems to me that he was trying to use the database to show errors in
his source data, but since his constraint would reject the data, he
wouldn't be able to enter it; all he could do would be to see the
error.  So he might as well turn it round, normalise the data properly
and use the database to tell the rest of the system what the data ought
to be.

Oliver Elphick




In response to

Responses

pgsql-sql by date

Next:From: Jan WieckDate: 2004-08-19 21:41:07
Subject: Re: multi column foreign key for implicitly unique columns
Previous:From: Josh BerkusDate: 2004-08-19 16:21:59
Subject: Re: multi column foreign key for implicitly unique columns

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