Re: Disable Triggers

Поиск
Список
Период
Сортировка
От Andrew Sullivan
Тема Re: Disable Triggers
Дата
Msg-id 20080221180543.GE18657@crankycanuck.ca
обсуждение исходный текст
Ответ на Re: Disable Triggers  (Terry Lee Tucker <terry@chosen-ones.org>)
Ответы Re: Disable Triggers
Список pgsql-general
On Thu, Feb 21, 2008 at 12:49:48PM -0500, Terry Lee Tucker wrote:
>
> Thanks for the input. I've been using the reltriggers in pg_class for a long
> time and it does work; however,  I did notice in the documentation on
> pg_trigger that tgenabled is not checked properly and using that will give
> inconsistant results. We have several valid reasons for disabling all
> triggers that I won't elaborate here.

I'm not arguing that you have those valid reasons.  I'm just warning you
that your success so far with this strategy does not guarantee future
results.

> Unless I get a better idea, I'm going to change the disable_triggers function
> to duplicate all the records in pg_trigger belonging to a given table, delete
> the records except for the Slony trigger, update pg_class setting reltriggers
> to 1, do the work, and then restore everything with a call to
> enable_triggers. Does this sound reasonable to you?

I expect you're going to have to get everyone to disconnect after that,
because the triggers oids will all have changed and you'll get errors to
that effect.  Also, are there these triggers on the slony replicas?  You
really need to be doing DROP TRIGGER/STORE TRIGGER operations if so.
Otherwise, very surprising things may happen.

A


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Disable Triggers
Следующее
От: Andrew Sullivan
Дата:
Сообщение: Re: Disable Triggers