Hello,
I have an extension that contains a configuration table with a before insert trigger that I setup to dump with pg_extension_config_dump(). Because the table and trigger are setup during CREATE EXTENSION time emitted by the dump, and the dumped table is then COPY'd outside of that, the triggers get re-fired. This doesn't happen for non-extension tables, which don't run CREATE TRIGGER until after the COPY.
Trying to find the best way to solve this problem in general for extension users so that they don't have to use --disable-triggers on the dump or restore as this seems like a rare edge case. Can anyone suggest a better way?
I'm wondering, would it make sense to extend pg_extension_config_dump() with a disable_triggers argument, that defaults to false, and if set to true, pg_dump will emit DISABLE/ENABLE guards around the config table's COPY statement? Just a wild idea.
Thanks!
-Michel