Fix match_foreign_keys_to_quals for FKs linking to unused rtable entries.
Tom Lane <tgl@sss.pgh.pa.us>
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>
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/optimizer/plan/initsplan.c | modified | +17 −2 |
| src/test/regress/expected/foreign_key.out | modified | +22 −0 |
| src/test/regress/sql/foreign_key.sql | modified | +10 −0 |