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 8ACB530EF45 for ; Tue, 17 Jun 2003 18:50:39 +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 73395-01 for ; Tue, 17 Jun 2003 15:50:29 -0300 (ADT) Received: from davinci.ethosmedia.com (unknown [209.10.40.251]) by svr1.postgresql.org (Postfix) with ESMTP id 4EEE230EF13 for ; Tue, 17 Jun 2003 15:50:28 -0300 (ADT) Received: from [66.219.92.2] (HELO temoku) by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.0.2) with ESMTP id 3128775; Tue, 17 Jun 2003 11:50:37 -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:49:44 -0700 User-Agent: KMail/1.4.3 References: <1164.219.65.230.103.1055871254.squirrel@mail.trade-india.com> <200306171131.24578.josh@agliodbs.com> <1182.219.65.230.103.1055875666.squirrel@mail.trade-india.com> In-Reply-To: <1182.219.65.230.103.1055875666.squirrel@mail.trade-india.com> Cc: pgsql-sql@postgresql.org MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200306171149.44425.josh@agliodbs.com> X-Archive-Number: 200306/202 X-Sequence-Number: 13960 Mallah, > in past we tried creating a plpgsql function that takes relname and sche= ma > and try setting reltriggers=3D0 on disabling and =3D (select count(*) fr= om=20 pg_trigger > for that relname and schema) on enabling . >=20 > we got stuck somewhere and abandoned it , do u think above approach > would work in principle ? Yes. As I said, I've used it before.=20=20 An additional safeguard you can use is enclosing everything in a transactio= n,=20 that is: BEGIN disable triggers load data enable triggers END --=20 -Josh Berkus Aglio Database Solutions San Francisco