X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.193]) by svr1.postgresql.org (Postfix) with ESMTP id 71E5B30ECBC for ; Tue, 17 Jun 2003 18:32:22 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr1.postgresql.org [64.117.224.193]) (amavisd-new, port 10024) with ESMTP id 69761-04 for ; Tue, 17 Jun 2003 15:32:12 -0300 (ADT) Received: from davinci.ethosmedia.com (unknown [209.10.40.251]) by svr1.postgresql.org (Postfix) with ESMTP id 35CF230EFAD for ; Tue, 17 Jun 2003 15:32:09 -0300 (ADT) Received: from [66.219.92.2] (HELO temoku) by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.0.2) with ESMTP id 3128695; Tue, 17 Jun 2003 11:32:18 -0700 Content-Type: text/plain; charset="iso-8859-1" From: Josh Berkus Reply-To: josh@agliodbs.com Organization: Aglio Database Solutions To: Subject: Re: disabling triggers Date: Tue, 17 Jun 2003 11:31:24 -0700 User-Agent: KMail/1.4.3 Cc: References: <1164.219.65.230.103.1055871254.squirrel@mail.trade-india.com> <200306171058.44814.josh@agliodbs.com> <1175.219.65.230.103.1055873842.squirrel@mail.trade-india.com> In-Reply-To: <1175.219.65.230.103.1055873842.squirrel@mail.trade-india.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200306171131.24578.josh@agliodbs.com> X-Archive-Number: 200306/197 X-Sequence-Number: 13955 Mallah, > >> Is setting reltriggers=3D0 on pg_class an accepatble way of > >> disabling triggers on a table temporarily? >=20 > Ok , but someone on list was scary few months back. I've done it many times without a problem. The trick is re-setting the=20 triggers to the correct number when you're done. See the scripts that=20 pg_dump -a creates for a good example. > Agreed , but there is no easy way to view current trigger defination of > existing triggers before dropping from psql . So? Create a perl script. It can: 1) query the system tables to find out the trigger definintion (you'll need pg_trigger, pg_proc, and pg_type) 2) generate a script to restore all the triggers to be used later; 3) drop all the triggers Of course, setting reltriggers=3D0 is probably a lot easier. --=20 -Josh Berkus Aglio Database Solutions San Francisco