Re: Query::targetList and RETURNING

From: Marko Tiikkaja <marko(dot)tiikkaja(at)cs(dot)helsinki(dot)fi>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Query::targetList and RETURNING
Date: 2009-11-10 16:11:13
Message-ID: 4AF990A1.807@cs.helsinki.fi
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
> Marko Tiikkaja <marko(dot)tiikkaja(at)cs(dot)helsinki(dot)fi> writes:
>> I wouldn't care for this at all, but with things the way they are right
>> now, the writeable CTE patch has to do quite a few of these:
>
> [ shrug... ] How many is "quite a few"? In a quick search for existing
> references to targetList in the planner, it looked to me like the
> majority were places that wouldn't be relevant for writable CTEs anyway.
> For example, none of the references in allpaths.c are, because they have
> to do with deciding whether quals can be pushed down into the subquery.
> And the answer to that, for a non-SELECT CTE, is always "no".

It appears we have four of those at the moment (hmm.. I thought there
were more).

> Just a thought ... where you do need this, would it be better to phrase
> it as
>
> if (query->returningList)
> cteList = query->returningList;
> else
> cteList = query->targetList;
>
> ? I'm not sure myself, but it's something to consider.

My initial thought is that this won't work because there might not be a
RETURNING clause, but I'm not sure.

Regards,
Marko Tiikkaja

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2009-11-10 16:19:45 Re: Query::targetList and RETURNING
Previous Message Tom Lane 2009-11-10 16:02:24 Re: Query::targetList and RETURNING