Re: ANY_VALUE aggregate

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: "David G. Johnston" <david.g.johnston@gmail.com>
Cc: Vik Fearing <vik@postgresfriends.org>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2022-12-05T18:04:39Z
Lists: pgsql-hackers
"David G. Johnston" <david.g.johnston@gmail.com> writes:
> Can we please add "first_value" and "last_value" if we are going to add
> "some_random_value" to our library of aggregates?

First and last according to what ordering?  We have those in the
window-aggregate case, and I don't think we want to encourage people
to believe that "first" and "last" are meaningful otherwise.

ANY_VALUE at least makes it clear that you're getting an unspecified
one of the inputs.

			regards, tom lane



Commits

  1. Implement ANY_VALUE aggregate

  2. Generalize ri_RootToPartitionMap to use for non-partition children