Re: First Aggregate Funtion?

Поиск
Список
Период
Сортировка
От Paul A Jungwirth
Тема Re: First Aggregate Funtion?
Дата
Msg-id CA+renyURWvNyYiR++4zbzuXyzrY0jBgS0ViQYM2Lj0A8B7M=YQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: First Aggregate Funtion?  (Merlin Moncure <mmoncure@gmail.com>)
Ответы Re: First Aggregate Funtion?  (Corey Huinker <corey.huinker@gmail.com>)
Re: First Aggregate Funtion?  (Merlin Moncure <mmoncure@gmail.com>)
Список pgsql-hackers
> The above implementation of "first" aggregate returns the first non-NULL item
> value.

I'm curious what advantages this approach has over these FIRST/LAST
functions from the Wiki?:
   https://wiki.postgresql.org/wiki/First/last_%28aggregate%29

Also to get the "first non-null value" you can apply an ordering to
just the aggregate function, e.g.:
   select first(id order by start_time nulls last) from events;

If you want speed you should probably write a C version.

Is there something I'm missing?

Also since we're on the hackers list is this a proposal to add these
functions to core Postgres?

Yours,
Paul



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

Предыдущее
От: Merlin Moncure
Дата:
Сообщение: Re: First Aggregate Funtion?
Следующее
От: Pavel Stehule
Дата:
Сообщение: Re: patch: enhanced DROP POLICY tab complete