Now that plans have flat rangetable lists, it's a lot easier to get EXPLAIN to
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 23 Feb 2007 21:59:45 +0000 (21:59 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 23 Feb 2007 21:59:45 +0000 (21:59 +0000)
commit655aa5b33026182f13b141a8ae4009bc7583b508
treeb1d548e8326f6d1bb61251da716d8f5809460292
parent9cc2a71c3818f9670be989435c2021af407e87ce
Now that plans have flat rangetable lists, it's a lot easier to get EXPLAIN to
drill down into subplan targetlists to print the referent expression for an
OUTER or INNER var in an upper plan node.  Hence, make it do that always, and
banish the old hack of showing "?columnN?" when things got too complicated.

Along the way, fix an EXPLAIN bug I introduced by suppressing subqueries from
execution-time range tables: get_name_for_var_field() assumed it could look at
rte->subquery to find out the real type of a RECORD var.  That doesn't work
anymore, but instead we can look at the input plan of the SubqueryScan plan
node.
src/backend/commands/explain.c
src/backend/optimizer/plan/setrefs.c
src/backend/utils/adt/ruleutils.c
src/include/utils/builtins.h