Re: Idea: Add first() and last() aggregate functions to the main release

Поиск
Список
Период
Сортировка
От Erwin Brandstetter
Тема Re: Idea: Add first() and last() aggregate functions to the main release
Дата
Msg-id CAGHENJ5QVH5gRLSEBMapgYi_zAcAartu8hBmrNomnVYLez=44g@mail.gmail.com
обсуждение исходный текст
Ответ на Idea: Add first() and last() aggregate functions to the main release  (Ben Clements <benhasgonewalking@gmail.com>)
Список pgsql-general
On Sat, 11 Mar 2023 at 23:38, Ben Clements <benhasgonewalking@gmail.com> wrote:
Idea/request for enhancement: 

Add the first() and last() aggregate functions to the main release (CREATE EXTENSION first_last_agg).



Reason: As a non-dba, I can’t install additional modules like first_last_agg.


For what it's worth, I support the inclusion of first() and last() in the main release. It makes queries involving multiple aggregate functions a lot simpler. Most hosted services only allow official contrib modules.
The module has been around for more than 10 years now. First on https://www.pgxn.org/dist/first_last_agg, then on https://github.com/wulczer/first_last_agg. And it's been available from apt.postgresql.org for a long time now.
Related questions pop up on Stackoverflow every now and then.
(I don't see anything related in the Postgres Todo, yet.)

The implementation in the additional module first_last_agg looks very simple and straight-forward. Might be an easy task to incorporate into mainline Postgres. But my C foo is just not good enough to judge whether the implementation is ideal.

Regards
Erwin

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

Предыдущее
От: Ron
Дата:
Сообщение: Re: confusion between max_standby_archive_delay, max_standby_archive_delay and max_standby_archive_delay
Следующее
От: Martijn de Munnik
Дата:
Сообщение: Re: ERROR: only immutable functions supported in continuous aggregate view