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 DC42E9DCC72 for ; Fri, 24 Feb 2006 14:43:40 -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 73801-07-5 for ; Fri, 24 Feb 2006 14:43:39 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from matrix.gatewaynet.com (host2.dynacom.ondsl.gr [62.103.35.210]) by postgresql.org (Postfix) with ESMTP id 25C509DC87B for ; Fri, 24 Feb 2006 14:43:31 -0400 (AST) Received: from matrix.gatewaynet.com (localhost.localdomain [127.0.0.1]) by matrix.gatewaynet.com (8.12.8/8.12.8) with ESMTP id k1OJlpOp020266; Fri, 24 Feb 2006 21:47:51 +0200 Received: from localhost (achill@localhost) by matrix.gatewaynet.com (8.12.8/8.12.8/Submit) with ESMTP id k1OJlpVG020262; Fri, 24 Feb 2006 21:47:51 +0200 Date: Fri, 24 Feb 2006 21:47:51 +0200 (EET) From: Achilleus Mantzios To: Tom Lane cc: pgsql-sql@postgresql.org Subject: Re: After Trigger assignment to NEW In-Reply-To: <3649.1140797162@sss.pgh.pa.us> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=ISO-8859-7 Content-Transfer-Encoding: 8BIT X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.111 required=5 tests=[AWL=0.111] X-Spam-Score: 0.111 X-Spam-Level: X-Archive-Number: 200602/301 X-Sequence-Number: 24311 O Tom Lane έγραψε στις Feb 24, 2006 : > 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. Too late if someone wants to store it. I wanna store the intented original values, thats why i use AFTER trigger. But i would like to alter what a final AFTER trigger would see. I'll elabarote a little. An update happens. The row is stored. An after trigger is fired that alters some NEW columns (nullifies them), aiming for a subsequent trigger to see the altered results . It should be something like a pointer to a HeapTuple, (right?), so that would be feasible i suppose. I would not even make a post if it was something that trivial. I hope you get my point. > > regards, tom lane > > ---------------------------(end of broadcast)--------------------------- > TIP 9: In versions below 8.0, the planner will ignore your desire to > choose an index scan if your joining column's datatypes do not > match > -- -Achilleus