Another round of planner fixes for LATERAL.
Formerly, subquery pullup had no need to examine other entries in the range
table, since they could not contain any references to the subquery being
pulled up. That's no longer true with LATERAL, so now we need to be able
to visit rangetable subexpressions to replace Vars referencing the
pulled-up subquery. Also, this means that extract_lateral_references must
be unsurprised at encountering lateral PlaceHolderVars, since such might be
created when pulling up a subquery that's underneath an outer join with
respect to the lateral reference.
Branch
------
master
Details
-------
http://git.postgresql.org/pg/commitdiff/084a29c94f94b5a08aec9f68f3cfaf252f4fa17c
Modified Files
--------------
src/backend/optimizer/plan/initsplan.c | 22 ++++++-
src/backend/optimizer/prep/prepjointree.c | 66 ++++++++++++++++++++-
src/backend/optimizer/util/var.c | 17 ++++--
src/test/regress/expected/join.out | 94 +++++++++++++++++++++++++++++
src/test/regress/sql/join.sql | 16 +++++
5 files changed, 205 insertions(+), 10 deletions(-)