Am 07.09.2015 um 16:40 schrieb Tom Lane:
> Andrew Dunstan <andrew@dunslane.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