Re: Creating unique or "internal-use-only" column names (ColumnRef)

From: Peter Moser <pitiz29a(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Creating unique or "internal-use-only" column names (ColumnRef)
Date: 2015-09-08 08:54:12
Message-ID: 55EEA234.5080307@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Am 07.09.2015 um 16:40 schrieb Tom Lane:
> Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
>> On 09/07/2015 09:28 AM, Alvaro Herrera wrote:
>>> This seems pretty much the same as a junk attribute, if I understand you
>>> correctly. I suggest given a look at how those work.
>
>> Is that actually documented anywhere much?
>
> I don't think there's much besides a code comment here and there.
> Grepping for functions that touch the "resjunk" field of TargetListEntries
> should give you the lay of the land.
>
> regards, tom lane
>

I have marked them as resjunk already. The problem is that the subquery
I build contains another subquery. As SQL it looks something like the
following:

select *
from
(select *, row_number() over () rn from r) r
left outer join
(select *, ts p1 from r union all select *, te p1 from r) s
on p1 >= r.ts and p1 < r.te
order by rn, p1;

I set then the output columns of the outer select to resjunk for rn and
p1, like this...

i = list_length(qry->targetList);
get_tle_by_resno(qry->targetList, i)->resjunk = true;
get_tle_by_resno(qry->targetList, --i)->resjunk = true;

However, I cannot do that inside, because I need them above... or do I
miss something here?

~peter

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Etsuro Fujita 2015-09-08 09:25:54 Re: Hooking at standard_join_search (Was: Re: Foreign join pushdown vs EvalPlanQual)
Previous Message 周正中 (德歌) 2015-09-08 07:58:26 答复:[HACKERS] 答复:[HACKERS] about fsync in CLOG buffer write