]> 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:42 +0000 (13:46 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Sat, 9 Aug 2014 17:46:42 +0000 (13:46 -0400)
commit7a9c8cefb8292c8cdf50ee96ade2b073813964e4
treeed2cfe86a6f22f60d0372eb7fdd3734ac396a1b6
parentfca9f349ba6815ccf4f6ad0747a86549ccf8685e
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