From: Tom Lane Date: Tue, 7 Aug 2018 19:43:48 +0000 (-0400) Subject: Fix pg_upgrade to handle event triggers in extensions correctly. X-Git-Tag: REL_11_BETA4~138 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=187331fefdb0b4cc2c2aaab42c754dcafa2a0f08;p=postgresql Fix pg_upgrade to handle event triggers in extensions correctly. pg_dump with --binary-upgrade must emit ALTER EXTENSION ADD commands for all objects that are members of extensions. It forgot to do so for event triggers, as per bug #15310 from Nick Barnes. Back-patch to 9.3 where event triggers were introduced. Haribabu Kommi Discussion: https://postgr.es/m/153360083872.1395.4593932457718151600@wrigleys.postgresql.org --- diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c index 7012c3355d..e1d27bb3ac 100644 --- a/src/bin/pg_dump/pg_dump.c +++ b/src/bin/pg_dump/pg_dump.c @@ -17293,6 +17293,10 @@ dumpEventTrigger(Archive *fout, EventTriggerInfo *evtinfo) appendPQExpBuffer(delqry, "DROP EVENT TRIGGER %s;\n", qevtname); + if (dopt->binary_upgrade) + binary_upgrade_extension_member(query, &evtinfo->dobj, + "EVENT TRIGGER", qevtname, NULL); + if (evtinfo->dobj.dump & DUMP_COMPONENT_DEFINITION) ArchiveEntry(fout, evtinfo->dobj.catId, evtinfo->dobj.dumpId, evtinfo->dobj.name, NULL, NULL,