pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Allow an aggregate's planner support function to be set via CREA 2+ messages / 1 participants [nested] [flat]
* pgsql: Allow an aggregate's planner support function to be set via CREA @ 2026-08-23 16:43 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 2+ messages in thread From: Tom Lane @ 2026-08-23 16:43 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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 <lepihov@gmail.com> Author: Tom Lane <tgl@sss.pgh.pa.us> Reviewed-by: Andrei Lepikhov <lepihov@gmail.com> Discussion: https://postgr.es/m/8f58c96d-d3c7-4c0f-9898-116f00eeaff6@gmail.com Backpatch-through: 19 Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/8aa49d34e977affb21f3cdbf17661c9c64753f42 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(-) ^ permalink raw reply [nested|flat] 2+ messages in thread
* pgsql: Allow an aggregate's planner support function to be set via CREA @ 2026-08-23 16:43 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 2+ messages in thread From: Tom Lane @ 2026-08-23 16:43 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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 <lepihov@gmail.com> Author: Tom Lane <tgl@sss.pgh.pa.us> Reviewed-by: Andrei Lepikhov <lepihov@gmail.com> Discussion: https://postgr.es/m/8f58c96d-d3c7-4c0f-9898-116f00eeaff6@gmail.com 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(-) ^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2026-08-23 16:43 UTC | newest] Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2026-08-23 16:43 pgsql: Allow an aggregate's planner support function to be set via CREA Tom Lane <tgl@sss.pgh.pa.us> 2026-08-23 16:43 pgsql: Allow an aggregate's planner support function to be set via CREA Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox