Fix oversight in outer join removal.
Tom Lane <tgl@sss.pgh.pa.us>
Fix oversight in outer join removal. A placeholder that references the outer join's relid in ph_eval_at is logically "above" the join, and therefore we can't remove its PlaceHolderInfo: it might still be used somewhere in the query. This was not an issue pre-v16 because we failed to remove the join at all in such cases. The new outer-join-aware-Var infrastructure permits deducing that it's okay to remove the join, but then we have to clean up correctly afterwards. Report and fix by Richard Guo Discussion: https://postgr.es/m/CAMbWs4_tuVn9EwwMcggGiZJWWstdXX_ci8FeEU17vs+4nLgw3w@mail.gmail.com
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/optimizer/plan/analyzejoins.c | modified | +2 −1 |
| src/test/regress/expected/join.out | modified | +57 −0 |
| src/test/regress/sql/join.sql | modified | +34 −0 |
Discussion
- ERROR: no relation entry for relid 6 11 messages · 2023-05-23 → 2023-06-09