X-Original-To: pgsql-php-postgresql.org@localhost.postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id CCFA69FA43C for ; Sun, 4 Jun 2006 11:16:08 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 17714-02 for ; Sun, 4 Jun 2006 11:15:58 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from eastrmmtao02.cox.net (eastrmmtao02.cox.net [68.230.240.37]) by postgresql.org (Postfix) with ESMTP id EC1A59F9DB0 for ; Sun, 4 Jun 2006 11:15:58 -0300 (ADT) Received: from [192.168.0.8] (really [24.170.195.52]) by eastrmmtao02.cox.net (InterMail vM.6.01.06.01 201-2131-130-101-20060113) with ESMTP id <20060604141557.PMKT15470.eastrmmtao02.cox.net@[192.168.0.8]>; Sun, 4 Jun 2006 10:15:57 -0400 From: Robert Treat To: pgsql-php@postgresql.org Subject: Re: disabling triggers temporaly Date: Sun, 4 Jun 2006 10:15:49 -0400 User-Agent: KMail/1.8.3 Cc: Mario Medina References: <447FC484.3090301@soweb.com.mx> In-Reply-To: <447FC484.3090301@soweb.com.mx> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200606041015.49731.xzilla@users.sourceforge.net> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200606/5 X-Sequence-Number: 3530 On Friday 02 June 2006 00:54, Mario Medina wrote: > Hi! does it exists any way to make that a trigger be disabled only for > one insert and for other inserts not? > > I have a table, every insert,update or delete on it activates a trigger > that do some tasks, but i wish that when i call special > insert/update/delete on that table the trigger doesn't starts... > > The only way i think to do that is to start a transaction, delete the > trigger, do the insert on the table, create the trigger again an commit > the transaction..., and another is to make the trigger to check some > value, and if that value is 1 the trigger works, if it is 0 the trigger > doesn't, but i wish to know if it is a better way. > You can do this with alter table... see http://www.postgresql.org/docs/8.1/interactive/sql-altertable.html -- Robert Treat Build A Brighter Lamp :: http://www.brighterlamp.org