pgsql: Reject duplicate column names in foreign key referenced-columns

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Reject duplicate column names in foreign key referenced-columns
Date: 2014-08-09 17:47:22
Message-ID: E1XGAji-0005Et-MV@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Reject duplicate column names in foreign key referenced-columns lists.

Such cases are disallowed by the SQL spec, and even if we wanted to allow
them, the semantics seem ambiguous: how should the FK columns be matched up
with the columns of a unique index? (The matching could be significant in
the presence of opclasses with different notions of equality, so this issue
isn't just academic.) However, our code did not previously reject such
cases, but instead would either fail to match to any unique index, or
generate a bizarre opclass-lookup error because of sloppy thinking in the
index-matching code.

David Rowley

Branch
------
REL9_4_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/2f9912335c198f7ee8ec8c46a72f947c9c1c2257

Modified Files
--------------
src/backend/commands/tablecmds.c | 51 ++++++++++++++++++++++----------------
1 file changed, 29 insertions(+), 22 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2014-08-09 20:35:45 pgsql: Further cleanup of JSON-specific error messages.
Previous Message Peter Eisentraut 2014-08-09 04:28:37 pgsql: Small message fixes