Re: Strange result with LATERAL query
От
Andrew Gierth
Тема
Re: Strange result with LATERAL query
Дата
Msg-id
8737lucp4m.fsf@news-spur.riddles.org.uk
Ответ на
Strange result with LATERAL query (Jeevan Chalke)
Список
Дерево обсуждения
Strange result with LATERAL query Jeevan Chalke <jeevan.chalke@enterprisedb.com>
Re: Strange result with LATERAL query Andrew Gierth <andrew@tao11.riddles.org.uk>
Re: Strange result with LATERAL query Tom Lane <tgl@sss.pgh.pa.us>
Re: Strange result with LATERAL query Andrew Gierth <andrew@tao11.riddles.org.uk>
Re: Strange result with LATERAL query Andrew Gierth <andrew@tao11.riddles.org.uk>
Re: Strange result with LATERAL query Tom Lane <tgl@sss.pgh.pa.us>
Re: Strange result with LATERAL query Andrew Gierth <andrew@tao11.riddles.org.uk>
Re: Strange result with LATERAL query Tom Lane <tgl@sss.pgh.pa.us>
Re: Strange result with LATERAL query Pavel Stehule <pavel.stehule@gmail.com>
Re: Strange result with LATERAL query Andrew Gierth <andrew@tao11.riddles.org.uk>
Re: Strange result with LATERAL query Andrew Gierth <andrew@tao11.riddles.org.uk>
>>>>> "Jeevan" == Jeevan Chalke writes:
Jeevan> Hi,Jeevan> While playing with LATERAL along with some aggregates inJeevan> sub-query, I have observed somewhat unusual behavior.
Simpler example not needing LATERAL:
select array(select sum(x+y) from generate_series(1,3) y group by y) from generate_series(1,3) x;?column?
----------{2,4,3}{2,4,3}{2,4,3}
(3 rows)
This is broken all the way back, it's not a recent bug.
Something is wrong with the way chgParam is being handled in Agg nodes.
The code in ExecReScanAgg seems to assume that if the lefttree doesn't
have any parameter changes then it suffices to re-project the data from
the existing hashtable; but of course this is nonsense if the parameter
is in an input to an aggregate function.
--
Andrew (irc:RhodiumToad)
В списке pgsql-hackers по дате отправления