Don't constrain self-join removal due to PHVs
authorAlexander Korotkov
Sun, 24 Dec 2023 23:24:25 +0000 (01:24 +0200)
committerAlexander Korotkov
Sun, 24 Dec 2023 23:33:26 +0000 (01:33 +0200)
commitb5fb6736ed3b6875e2a4ca39d33325147f535137
tree3d5e2ebf0170d00316542ad5da52bc08cad19643
parent8a8ed916f73f4f16e8eb3e0e30ac1201a7642fda
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
src/backend/optimizer/plan/analyzejoins.c
src/test/regress/expected/join.out
src/test/regress/sql/join.sql