]> granicus.if.org Git - postgresql/commit
Reject duplicate column names in foreign key referenced-columns lists.
authorTom Lane <tgl@sss.pgh.pa.us>
Sat, 9 Aug 2014 17:46:48 +0000 (13:46 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Sat, 9 Aug 2014 17:46:48 +0000 (13:46 -0400)
commitbbe826f21b4fd2bbb60eba1d90e27a520be64bc0
treee1643f80f74e7672a0ecfcaa3466be7056ae52dd
parent709bdd8d8dac933f3b9fcd338bf1b379b6234405
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
src/backend/commands/tablecmds.c