]> granicus.if.org Git - postgresql/commit
Fix match_foreign_keys_to_quals for FKs linking to unused rtable entries.
authorTom Lane <tgl@sss.pgh.pa.us>
Wed, 29 Jun 2016 20:02:08 +0000 (16:02 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Wed, 29 Jun 2016 20:02:08 +0000 (16:02 -0400)
commitb32e63506cfec8c8bd3237ec5043de7414564d10
tree2e4560ea909aaa47fa32fec31796aababc4ecad0
parent4242a715c3fca1a8fa31f810b7cffa88b4d4e439
Fix match_foreign_keys_to_quals for FKs linking to unused rtable entries.

Since get_relation_foreign_keys doesn't try to determine whether RTEs
are actually part of the query semantics, it might make FK info records
linking to RTEs that won't have a RelOptInfo at all.  Cope with that.
Per bug #14219 from Andrew Gierth.

Report: <20160629183338.1397.43514@wrigleys.postgresql.org>
src/backend/optimizer/plan/initsplan.c
src/test/regress/expected/foreign_key.out
src/test/regress/sql/foreign_key.sql