Re: Foreign key column reference ordering and information_schema - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Foreign key column reference ordering and information_schema
Date
Msg-id 20680.1147881927@sss.pgh.pa.us
Whole thread Raw
In response to Re: Foreign key column reference ordering and information_schema  (Stephan Szabo <sszabo@megazone.bigpanda.com>)
List pgsql-hackers
Stephan Szabo <sszabo@megazone.bigpanda.com> writes:
> On Wed, 17 May 2006, Tom Lane wrote:
>> where SQL2003 has
>> 
>>     If the <referenced table and columns> specifies a <reference column
>>     list>, then there shall be a one-to-one correspondence between the
>>     set of <column name>s contained in that <reference column list>
>>     and the set of <column name>s contained in the <unique column
>>     list> of a unique constraint of the referenced table such that
>>     corresponding <column name>s are equivalent. Let referenced columns
>>     be the column or columns identified by that <reference column
>>     list> and let referenced column be one such column. Each referenced
>>     column shall identify a column of the referenced table and the same
>>     column shall not be identified more than once.
>> 
>> I think SQL2003 is actually just trying to say the same thing in more
>> precise language: you have to be able to match up the columns in the
>> <reference list> with some unique constraint.  I don't think the "one
>> to one" bit is meant to imply a left-to-right-ordered correspondence;
>> that's certainly not the mathematical meaning of a one-to-one function
>> for instance.

> No, but the part which says corresponding column names are equivalent
> seems to imply it to me.

No, that's just saying the names have to actually match.  Otherwise I
could say that I can put "A B C" into a one-to-one correspondence with
"D E F" because there are the same number of elements in each set.
The whole sentence was written by a pedant and is not an improvement in
intelligibility over the SQL92/99 wording, but I really think it is not
intended to imply anything functionally different.  Again, if they did
intend to change the allowable matches, why doesn't Annex E mention it?
        regards, tom lane


pgsql-hackers by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: Foreign key column reference ordering and information_schema
Next
From: Tom Lane
Date:
Subject: Re: Foreign key column reference ordering and information_schema