Re: disabling triggers?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: disabling triggers?
Дата
Msg-id 18218.963935778@sss.pgh.pa.us
обсуждение исходный текст
Ответ на disabling triggers?  (Bob Parkinson <rwp@biome.ac.uk>)
Список pgsql-general
Bob Parkinson <rwp@biome.ac.uk> writes:
> I've got a trigger/function pair that I need to disable while I do a
> manual update. Is it safe to drop the trigger, then re-create it on its
> own, or should I do the trigger/function pair.

Dropping the trigger seems sufficient.  Dropping the function has at
least one big disadvantage: if the same function is supporting similar
triggers on other tables, dropping the function would break those
triggers.

> Is there a better method of temporarily disabling a trigger?

You could reach in and hack the reltriggers field in pg_class,
but dropping and recreating the trigger seems a lot cleaner and
safer.

            regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: ordering of 'where' sub clauses
Следующее
От: Stephan Szabo
Дата:
Сообщение: Re: ordering of 'where' sub clauses