Don't constrain self-join removal due to PHVs
Alexander Korotkov <akorotkov@postgresql.org>
Don't constrain self-join removal due to PHVs Self-join removal appears to be safe to apply with placeholder variables as long as we handle PlaceHolderVar in replace_varno_walker() and replace relid in phinfo->ph_lateral. Discussion: https://postgr.es/m/18187-831da249cbd2ff8e%40postgresql.org Author: Richard Guo Reviewed-by: Andrei Lepikhov
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/optimizer/plan/analyzejoins.c | modified | +4 −14 |
| src/test/regress/expected/join.out | modified | +28 −11 |
| src/test/regress/sql/join.sql | modified | +7 −3 |
Discussion
- BUG #18187: Unexpected error: "variable not found in subplan target lists" triggered by JOIN 24 messages · 2023-11-07 → 2023-12-25