pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@commandprompt.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Achilleus Mantzios <achill@matrix.gatewaynet.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: After Trigger assignment to NEW
Date: Fri, 24 Feb 2006 14:16:52 -0300
Message-ID: <20060224171652.GD7696@surnet.cl> (raw)
In-Reply-To: <3649.1140797162@sss.pgh.pa.us>
References: <Pine.LNX.4.44.0602241831280.19738-100000@matrix.gatewaynet.com>
	<3649.1140797162@sss.pgh.pa.us>

Tom Lane wrote:
> Achilleus Mantzios <achill@matrix.gatewaynet.com> 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.



view thread (9+ messages)  latest in thread

Message-ID: <20060224171652.GD7696@surnet.cl>
Permalink:  ../20060224171652.GD7696@surnet.cl/
Also on:    postgresql.org/message-id/20060224171652.GD7696@surnet.cl

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: alvherre@commandprompt.com, tgl@sss.pgh.pa.us, achill@matrix.gatewaynet.com
  Subject: Re: After Trigger assignment to NEW
  In-Reply-To: <20060224171652.GD7696@surnet.cl>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox