Re: Enhancement request: enable FIRST/LAST_value() also as a regular aggregate (not only as windowing function)

Поиск
Список
Период
Сортировка
Искать
От
Tom Lane
Тема
Re: Enhancement request: enable FIRST/LAST_value() also as a regular aggregate (not only as windowing function)
Дата
Msg-id
29473.1532629886@sss.pgh.pa.us
Ответ на
Список
Дерево обсуждения
Re: Enhancement request: enable FIRST/LAST_value() also as a regular aggregate (not only as windowing function) Tom Lane <tgl@sss.pgh.pa.us>
Re: Enhancement request: enable FIRST/LAST_value() also as a regularaggregate (not only as windowing function) Vik Fearing <vik.fearing@2ndquadrant.com>
matshyeq  writes:
> Can I make custom aggregate function that accepts WITHIN GROUP syntax?

It's possible, but it would have to be written in C, I think; see
src/backend/utils/adt/orderedsetaggs.c for prototype code.  You'll
find it a lot easier to write a plain aggregate function and control
its input ordering with "last(foo order by foo)".

			regards, tom lane

В списке pgsql-hackers по дате отправления
FAQ