Stupid question about triggers

Поиск
Список
Период
Сортировка
От Mauri Sahlberg
Тема Stupid question about triggers
Дата
Msg-id 43218C15.1070704@claymountain.com
обсуждение исходный текст
Ответы Re: Stupid question about triggers  (Robert Treat <xzilla@users.sourceforge.net>)
Список pgsql-admin
Hi,

I have found myself in a situation where I need to quickly delete rows
from a production database. Unfortunately table for the rows to be
deleted have triggers which results massive chain of update operations
on other tables. I do not wish those to happen as I'm about to delete
concerned rows from the other tables as well. (7.4.7)

Would

begin work
select reltriggers from pg_class where relname='foo' for update;
update pg_class set reltriggers=0 where relname='foo';
delete from foo where ...
update pg_class set reltriggers=original value where relname='foo';
commit

work?

Or
begin work
select reltriggers from pg_class where relname='foo';
update pg_class set reltriggers=0 where relname='foo';
delete from foo where ...
update pg_class set reltriggers=original value where relname='foo';
commit

as I'm quite sure the number of triggers for that table will not change
while I'm doing the deletion.

Thank you.


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Stats turned on but not being updated
Следующее
От: Dilipan Sebastiampillai
Дата:
Сообщение: could not locate a valid checkpoint record