From c705a55db8923c21be7d00c315bafea2da8f7846 Mon Sep 17 00:00:00 2001 From: Fujii Masao Date: Fri, 24 Jul 2026 20:26:02 +0900 Subject: [PATCH v2 3/3] Invoke post-alter hook for ALTER PUBLICATION SET ALL Previously, ALTER PUBLICATION ... SET ALL TABLES and SET ALL SEQUENCES updated the pg_publication catalog without invoking the post-alter hook. As a result, object access hook users could miss changes made by these commands. Fix this by invoking the post-alter hook whenever a SET ALL command changes the publication state, using the updated catalog tuple. Backpatch to v19, where ALTER PUBLICATION SET ALL TABLES and SET ALL SEQUENCES were introduced. --- src/backend/commands/publicationcmds.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/backend/commands/publicationcmds.c b/src/backend/commands/publicationcmds.c index 5edbf1c7920..c2ed6606314 100644 --- a/src/backend/commands/publicationcmds.c +++ b/src/backend/commands/publicationcmds.c @@ -1647,9 +1647,14 @@ AlterPublicationAllFlags(AlterPublicationStmt *stmt, Relation rel, CatalogTupleUpdate(rel, &tup->t_self, tup); CommandCounterIncrement(); + pubform = (Form_pg_publication) GETSTRUCT(tup); + /* For ALL TABLES, we must invalidate all relcache entries */ if (replaces[Anum_pg_publication_puballtables - 1]) CacheInvalidateRelcacheAll(); + + InvokeObjectPostAlterHook(PublicationRelationId, + pubform->oid, 0); } return dirty; -- 2.55.0