Re: After Trigger assignment to NEW - Mailing list pgsql-sql

From Alvaro Herrera
Subject Re: After Trigger assignment to NEW
Date
Msg-id 20060224171652.GD7696@surnet.cl
Whole thread Raw
In response to Re: After Trigger assignment to NEW  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: After Trigger assignment to NEW
List pgsql-sql
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.


pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: After Trigger assignment to NEW
Next
From: Tom Lane
Date:
Subject: Re: After Trigger assignment to NEW