Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id DB98D9FB296 for ; Thu, 19 Oct 2006 01:27:46 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 19674-04 for ; Thu, 19 Oct 2006 04:27:42 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey- Received: from noel.decibel.org (noel.decibel.org [67.100.216.10]) by postgresql.org (Postfix) with ESMTP id C2CDF9FA4E5 for ; Thu, 19 Oct 2006 01:27:41 -0300 (ADT) Received: by noel.decibel.org (Postfix, from userid 1001) id C3E1B56456; Wed, 18 Oct 2006 23:27:40 -0500 (CDT) Received: (hashcash-sendmail, from uid 1001); Wed, 18 Oct 2006 23:27:38 -0500 Date: Wed, 18 Oct 2006 23:27:38 -0500 From: "Jim C. Nasby" To: Benjamin Krajmalnik Cc: pgsql-admin@postgresql.org Subject: Re: Rules/Triggers executio order Message-ID: <20061019042738.GD71084@nasby.net> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Operating-System: FreeBSD 6.1-RELEASE-p10 amd64 X-Distributed: Join the Effort! http://www.distributed.net User-Agent: Mutt/1.5.13 (2006-08-11) X-Hashcash: 1:20:061019:kraj@illumen.com::Vm4/JHZCxu1gxoYc:01S5L X-Hashcash: 1:20:061019:pgsql-admin@postgresql.org::Nkr1QC0jUojZ3Bt2:00000000000 0000000000000000000000009PBN X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200610/117 X-Sequence-Number: 23420 On Wed, Oct 18, 2006 at 06:42:21PM -0600, Benjamin Krajmalnik wrote: > I have a partitioned table to which I route data using a trigger. > I am changing it to use a set of rules which executes "INSTEAD" on > insert. > The parent table currently has a trigger. > > The system is a live system. I would prefer to not have to suspend the > data flow. > If I create the rules, and given the fact that they execute "INSTEAD" of > the insertion into the parent table, will the trigger still execute. > I will be removing the trigger immediately after the creation of the > rules, but just want to be safe and make sure I get no duplicate > entries. An INSTEAD OF rule replaces the query that you originally had with the one re-written by the rule, so no, the triggers shouldn't fire. But you should test to make sure. -- Jim Nasby jim@nasby.net EnterpriseDB http://enterprisedb.com 512.569.9461 (cell)