X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 0AB979DC801 for ; Fri, 24 Feb 2006 13:16:58 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 54935-05 for ; Fri, 24 Feb 2006 13:16:56 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mx1.surnet.cl (mx1.surnet.cl [216.155.73.180]) by postgresql.org (Postfix) with ESMTP id 80F399DC863 for ; Fri, 24 Feb 2006 13:16:55 -0400 (AST) Received: from unknown (HELO cluster.surnet.cl) ([216.155.73.165]) by mx1.surnet.cl with ESMTP; 24 Feb 2006 14:38:14 -0300 X-IronPort-AV: i="4.02,144,1139194800"; d="scan'208"; a="40677786:sNHT19699472" Received: from alvh.no-ip.org (201.221.200.155) by cluster.surnet.cl (7.0.043) (authenticated as alvherre@surnet.cl) id 43A978FD008246A1; Fri, 24 Feb 2006 14:16:52 -0300 Received: by alvh.no-ip.org (Postfix, from userid 1000) id 919AEC2C2DD; Fri, 24 Feb 2006 14:16:52 -0300 (CLST) Date: Fri, 24 Feb 2006 14:16:52 -0300 From: Alvaro Herrera To: Tom Lane Cc: Achilleus Mantzios , pgsql-sql@postgresql.org Subject: Re: After Trigger assignment to NEW Message-ID: <20060224171652.GD7696@surnet.cl> Mail-Followup-To: Tom Lane , Achilleus Mantzios , pgsql-sql@postgresql.org References: <3649.1140797162@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3649.1140797162@sss.pgh.pa.us> User-Agent: Mutt/1.5.11+cvs20060126 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=1.573 required=5 tests=[AWL=-0.346, DNS_FROM_RFC_ABUSE=0.479, DNS_FROM_RFC_POST=1.44] X-Spam-Score: 1.573 X-Spam-Level: * X-Archive-Number: 200602/297 X-Sequence-Number: 24307 Tom Lane wrote: > Achilleus Mantzios writes: > > Is there a reason that the NEW values should remain unchanged in AFTER > > row triggers? > > By definition, an AFTER trigger is too late to change what was stored. > Use a BEFORE trigger. But a BEFORE trigger would alter the stored tuple, which is not what Achilleus wants AFAIU. I think the desired effect can be had by having DBMirror check the source relation of the inserted tuple (There is a hidden attributa called tableoid IIRC that can be used for that, I think). -- Alvaro Herrera http://www.CommandPrompt.com/ The PostgreSQL Company - Command Prompt, Inc.