Re: JSON constructors and window functions

Поиск
Список
Период
Сортировка
Искать
От
Andres Freund
Тема
Re: JSON constructors and window functions
Дата
Msg-id
20220404163352.hmbd6isaxltlgu4d@alap3.anarazel.de
Ответ на
Список
Дерево обсуждения
JSON constructors and window functions Jaime Casanova <jcasanov@systemguards.com.ec>
Re: JSON constructors and window functions Andrew Dunstan <andrew@dunslane.net>
Re: JSON constructors and window functions Andrew Dunstan <andrew@dunslane.net>
Re: JSON constructors and window functions Andres Freund <andres@anarazel.de>
Re: JSON constructors and window functions Andrew Dunstan <andrew@dunslane.net>
Re: JSON constructors and window functions Andrew Dunstan <andrew@dunslane.net>
Re: JSON constructors and window functions Tom Lane <tgl@sss.pgh.pa.us>
Re: JSON constructors and window functions Andres Freund <andres@anarazel.de>
Re: JSON constructors and window functions Greg Stark <stark@mit.edu>
Re: JSON constructors and window functions Andres Freund <andres@anarazel.de>
Re: JSON constructors and window functions Andrew Dunstan <andrew@dunslane.net>
Re: JSON constructors and window functions "Jonathan S. Katz" <jkatz@postgresql.org>
Re: JSON constructors and window functions Andrew Dunstan <andrew@dunslane.net>
Re: JSON constructors and window functions "Jonathan S. Katz" <jkatz@postgresql.org>
Re: JSON constructors and window functions Andrew Dunstan <andrew@dunslane.net>
Hi,

On 2022-04-04 11:54:23 -0400, Greg Stark wrote:
> Are we missing regression tests using these functions as window functions?

So far, yes.

ISTM that 4eb97988796 should have at least included the crashing statement as
a test... The statement can be simpler too:

SELECT json_objectagg(k : v with unique keys) OVER (ORDER BY k) FROM (VALUES (1,1), (2,2)) a(k,v);

is sufficient to trigger the crash for me, without even using asan (after
reverting the bugfix, of course).


> Hm. I suppose it's possible to write a general purpose regression test
> that loops over all aggregate functions and runs them as window
> functions and aggregates over the same data sets and compares results.
> At least for the case of aggregate functions with a single parameter
> belonging to a chosen set of data types.

I was wondering about that too. Hardest part would be to come up with values
to pass to the aggregates.

I don't think it'd help in this case though, since it depends on special case
grammar stuff to even be reached. json_objectagg(k : v with unique
keys). "Normal" use of aggregates can't even reach the problematic path
afaics.

Greetings,

Andres Freund


В списке pgsql-hackers по дате отправления
От: Mark Dilger
Дата:
От: Robert Haas
Дата:
Сообщение: Re: Pluggable toaster
FAQ