Re: ANY_VALUE aggregate

Maciek Sakrejda <m.sakrejda@gmail.com>

From: Maciek Sakrejda <m.sakrejda@gmail.com>
To: Vik Fearing <vik@postgresfriends.org>
Cc: David Rowley <dgrowleyml@gmail.com>, Peter Eisentraut <peter.eisentraut@enterprisedb.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2023-02-15T06:30:11Z
Lists: pgsql-hackers
I could have used such an aggregate in the past, so +1.

This is maybe getting into nit-picking, but perhaps it should be
documented as returning an "arbitrary" value instead of a
"non-deterministic" one? Technically the value is deterministic:
there's a concrete algorithm specifying how it's selected. However,
the algorithm is reserved as an implementation detail, since the
function is designed for cases in which the caller should not care
which value is returned.

Thanks,
Maciek



Commits

  1. Implement ANY_VALUE aggregate

  2. Generalize ri_RootToPartitionMap to use for non-partition children