Disabling triggers on tables dumped with pg_extension_config_dump()

Поиск
Список
Период
Сортировка
От Michel Pelletier
Тема Disabling triggers on tables dumped with pg_extension_config_dump()
Дата
Msg-id CACxu=v+XNc3vVK88upwR9W_JXptG-4wq=j6Ft0FXphT64fCAoA@mail.gmail.com
обсуждение исходный текст
Список pgsql-general
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

В списке pgsql-general по дате отправления:

Предыдущее
От: Fred Habash
Дата:
Сообщение: Re: Autovacuum Hung Due to Bufferpin
Следующее
От: Ron
Дата:
Сообщение: Changing displayed time zone in RAISE NOTICE output?