Kerem Kat <kerem...@gmail.com> writes: > On Sat, Sep 24, 2011 at 19:51, Tom Lane <t...@sss.pgh.pa.us> wrote: >> Why? CORRESPONDING at a given set-operation level doesn't affect either >> sub-query, so I don't see why you'd need a different representation for >> the sub-queries.
> In the planner to construct a subquery out of SetOperationStmt or > RangeTblRef, a new RangeTblRef is needed. > To create a RangeTableRef, parser state is needed and planner assumes > root->parse->rtable be not modified > after generating simple_rte_array. Actually, after looking at the code again, I don't think you need any of that, since there's already a SubqueryScan node being inserted into the plan. You just need to improve generate_setop_tlist so that it can deal with cases where the mapping from subplan targetlist to the setop output columns isn't one-to-one. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers