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 <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>)
Список pgsql-hackers
>>>>> "Jeevan" == Jeevan Chalke <jeevan.chalke@enterprisedb.com> writes:
Jeevan> Hi,Jeevan> While playing with LATERAL along with some aggregates inJeevan> sub-query, I have observed somewhat
unusualbehavior.
 

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 по дате отправления:

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: Showing parallel status in \df+
Следующее
От: Andrew Gierth
Дата:
Сообщение: Re: Strange result with LATERAL query