ORDER BY clause in aggregate doesn't work well with multi argument aggregates

Поиск
Список
Период
Сортировка
Искать
От
Pavel Stehule
Тема
ORDER BY clause in aggregate doesn't work well with multi argument aggregates
Дата
Msg-id
162867790912251040q5bb0e4bfrf777b9305a601300@mail.gmail.com
Список
Дерево обсуждения
ORDER BY clause in aggregate doesn't work well with multi argument aggregates Pavel Stehule <pavel.stehule@gmail.com>
Re: ORDER BY clause in aggregate doesn't work well with multi argument aggregates Tom Lane <tgl@sss.pgh.pa.us>
Re: ORDER BY clause in aggregate doesn't work well with multi argument aggregates Pavel Stehule <pavel.stehule@gmail.com>
Re: ORDER BY clause in aggregate doesn't work well with multi argument aggregates Pavel Stehule <pavel.stehule@gmail.com>
Re: ORDER BY clause in aggregate doesn't work well with multi argument aggregates Pavel Stehule <pavel.stehule@gmail.com>
Re: ORDER BY clause in aggregate doesn't work well with multi argument aggregates Tom Lane <tgl@sss.pgh.pa.us>
Re: ORDER BY clause in aggregate doesn't work well with multi argument aggregates Pavel Stehule <pavel.stehule@gmail.com>
Re: ORDER BY clause in aggregate doesn't work well with multi argument aggregates Tom Lane <tgl@sss.pgh.pa.us>
Hello

It is maybe a bug. I cannot use ORDER BY clause in two parameter aggregate.

create aggregate la(text, text) (SFUNC=listagg2_transfn,
STYPE=internal, FINALFUNC=listagg_finalfn);

postgres=# select la(town,',') from country;             la
-------------------------------Prague,Brno,Bratislava,Kosice
(1 row)

but when I add ORDER BY clause

postgres=# select la(town order by town,',') from country;
ERROR:  function la(character varying) does not exist
LINE 1: select la(town order by town,',') from country;              ^
HINT:  No function matches the given name and argument types. You
might need to add explicit type casts.
postgres=#

Probably it don't use correct count of parameters, because when I add
one parameter aggregate:

postgres=# create aggregate la(text) (SFUNC=listagg1_transfn,
STYPE=internal, FINALFUNC=listagg_finalfn);
CREATE AGGREGATE

postgres=# select la(town order by town,',') from country;            la
----------------------------BratislavaBrnoKosicePrague
(1 row)

Then it working, but it call wrong aggregates.

Regards
Pavel Stehule

В списке pgsql-hackers по дате отправления
От: Andrew Dunstan
Дата:
От: Tom Lane
Дата:
FAQ