X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 42AD5D7882 for ; Fri, 9 Sep 2005 10:20:22 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 83437-08 for ; Fri, 9 Sep 2005 13:20:17 +0000 (GMT) Received: from gw02.mail.saunalahti.fi (gw02.mail.saunalahti.fi [195.197.172.116]) by svr1.postgresql.org (Postfix) with ESMTP id 4E745D782C for ; Fri, 9 Sep 2005 10:20:18 -0300 (ADT) Received: from [192.168.105.64] (psk105.pretax.net [195.197.242.66]) by gw02.mail.saunalahti.fi (Postfix) with ESMTP id 0154DD1ABE for ; Fri, 9 Sep 2005 16:20:20 +0300 (EEST) Message-ID: <43218C15.1070704@claymountain.com> Date: Fri, 09 Sep 2005 16:20:21 +0300 From: Mauri Sahlberg Organization: Claymountain Solutions Oy User-Agent: Mozilla Thunderbird 1.0.6 (X11/20050727) X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-admin Subject: Stupid question about triggers Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 required=5 tests=[none] X-Spam-Level: X-Archive-Number: 200509/94 X-Sequence-Number: 18831 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.