Re: ANY_VALUE aggregate

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: ANY_VALUE aggregate
Дата
Msg-id CAKFQuwau9pyMB=4S-RUEZ6_Nf_=BuSVb+7FKhjJqPyaSROjreQ@mail.gmail.com
обсуждение исходный текст
Ответ на ANY_VALUE aggregate  (Vik Fearing <vik@postgresfriends.org>)
Ответы Re: ANY_VALUE aggregate  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: ANY_VALUE aggregate  (Corey Huinker <corey.huinker@gmail.com>)
Re: ANY_VALUE aggregate  (Vik Fearing <vik@postgresfriends.org>)
Список pgsql-hackers
On Mon, Dec 5, 2022 at 7:57 AM Vik Fearing <vik@postgresfriends.org> wrote:
The SQL:2023 Standard defines a new aggregate named ANY_VALUE.  It
returns an implementation-dependent (i.e. non-deterministic) value from
the rows in its group.

PFA an implementation of this aggregate.


Can we please add "first_value" and "last_value" if we are going to add "some_random_value" to our library of aggregates?

Also, maybe we should have any_value do something like compute a 50/50 chance that any new value seen replaces the existing chosen value, instead of simply returning the first value all the time.  Maybe even prohibit the first value from being chosen so long as a second value appears.

David J.

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Request to modify view_table_usage to include materialized views
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Error-safe user functions