Another round of planner fixes for LATERAL.
authorTom Lane <tgl@sss.pgh.pa.us>
Sat, 18 Aug 2012 18:10:17 +0000 (14:10 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Sat, 18 Aug 2012 18:10:17 +0000 (14:10 -0400)
commit084a29c94f94b5a08aec9f68f3cfaf252f4fa17c
tree2db6b7aa778f8299fce6cbfde5ce63efc91eb5cf
parent18226849ea12c566fb2b3be505448e0ba289ea10
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.
src/backend/optimizer/plan/initsplan.c
src/backend/optimizer/prep/prepjointree.c
src/backend/optimizer/util/var.c
src/test/regress/expected/join.out
src/test/regress/sql/join.sql