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 regularaggregate (not only as windowing function)  (matshyeq <matshyeq@gmail.com>)
Ответы Re: Enhancement request: enable FIRST/LAST_value() also as a regularaggregate (not only as windowing function)  (Vik Fearing <vik.fearing@2ndquadrant.com>)
Список pgsql-hackers
matshyeq <matshyeq@gmail.com> 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 по дате отправления:

Предыдущее
От: matshyeq
Дата:
Сообщение: Re: Enhancement request: enable FIRST/LAST_value() also as a regularaggregate (not only as windowing function)
Следующее
От: Vik Fearing
Дата:
Сообщение: Re: Enhancement request: enable FIRST/LAST_value() also as a regularaggregate (not only as windowing function)