Allow an aggregate's planner support function to be set via CREATE AGGREGATE.
Commit 42473b3b3 implemented SupportRequestSimplifyAggref, but failed to think about what infrastructure would be required for an extension to use that: there is no SQL-level mechanism for attaching a planner support function to an aggregate. That seems pretty critical for a feature that's primarily intended to be used by extensions. To fix, add a SUPPORT clause to CREATE AGGREGATE, and teach pg_dump (and thereby pg_upgrade) about dumping this aggregate property. We don't need to touch ALTER AGGREGATE, because it's already the case that you're supposed to use CREATE OR REPLACE AGGREGATE if you want to alter any aggregate-specific properties set by CREATE AGGREGATE. (Maybe at some point we'll think that that policy ought to change, but I don't think this one feature moves the needle enough.) Per report from Andrei Lepikhov, who also provided some of the new documentation text. Reported-by: Andrei Lepikhov <[email protected]> Author: Tom Lane <[email protected]> Reviewed-by: Andrei Lepikhov <[email protected]> Discussion: https://postgr.es/m/[email protected] Backpatch-through: 19 Branch ------ REL_19_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/165aa5040a02e13011f07e3c6669ac0edf4f8258 Modified Files -------------- doc/src/sgml/ref/alter_aggregate.sgml | 7 ++++++ doc/src/sgml/ref/create_aggregate.sgml | 15 ++++++++++++ doc/src/sgml/xfunc.sgml | 18 +++++++++++++- src/backend/catalog/pg_aggregate.c | 33 +++++++++++++++++++++++++- src/backend/commands/aggregatecmds.c | 4 ++++ src/bin/pg_dump/pg_dump.c | 18 ++++++++++++-- src/include/catalog/pg_aggregate.h | 1 + src/test/regress/expected/create_aggregate.out | 15 ++++++++++++ src/test/regress/sql/create_aggregate.sql | 8 +++++++ 9 files changed, 115 insertions(+), 4 deletions(-)
