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

From Oliver Elphick
Subject Re: multi column foreign key for implicitly unique columns
Date
Msg-id 1092934366.19834.88.camel@braydb
Whole thread Raw
In response to Re: multi column foreign key for implicitly unique columns  (Josh Berkus <josh@agliodbs.com>)
Responses Re: multi column foreign key for implicitly unique columns  (Jan Wieck <JanWieck@Yahoo.com>)
List 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





pgsql-sql by date:

Previous
From: Josh Berkus
Date:
Subject: Re: multi column foreign key for implicitly unique columns
Next
From: Jan Wieck
Date:
Subject: Re: multi column foreign key for implicitly unique columns