Re: Adding CORRESPONDING to Set Operations

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Kerem Kat <keremkat(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Adding CORRESPONDING to Set Operations
Date: 2011-09-25 16:50:31
Message-ID: 1957.1316969431@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Kerem Kat <keremkat(at)gmail(dot)com> writes:
> On Sat, Sep 24, 2011 at 19:51, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2011-09-25 16:58:07 Re: unite recovery.conf and postgresql.conf
Previous Message Kevin Grittner 2011-09-25 16:22:03 Re: [v9.2] Fix Leaky View Problem