Re: multi column foreign key for implicitly unique columns

From: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>
To: Jan Wieck <JanWieck(at)Yahoo(dot)com>
Cc: Markus Bertheau <twanger(at)bluetwanger(dot)de>, 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:38:44
Message-ID: 20040818073152.W1646@megazone.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Wed, 18 Aug 2004, Jan Wieck wrote:

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

True, but the spec explicitly asks for the columns to be the members of a
unique constraint, not that the columns be provably unique. See the other
portion of the thread related to dropping constraints for other spec
extensions doing this implies. I think the actual specific change to make
it look for the subset should be trivial, but we'd really need to work
out those dependency issues at the very least and I'm afraid there are
more such little corners.

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Gaetano Mendola 2004-08-18 14:48:27 Re: SQL Challenge: Arbitrary Cross-tab
Previous Message Markus Bertheau 2004-08-18 14:28:49 Re: multi column foreign key for implicitly unique columns