Skip site navigation (1) Skip section navigation (2)

Re: After Trigger assignment to NEW

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Achilleus Mantzios <achill(at)matrix(dot)gatewaynet(dot)com>,pgsql-sql(at)postgresql(dot)org
Subject: Re: After Trigger assignment to NEW
Date: 2006-02-24 17:16:52
Message-ID: 20060224171652.GD7696@surnet.cl (view raw or flat)
Thread:
Lists: pgsql-sql
Tom Lane wrote:
> Achilleus Mantzios <achill(at)matrix(dot)gatewaynet(dot)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.

In response to

Responses

pgsql-sql by date

Next:From: Tom LaneDate: 2006-02-24 17:37:51
Subject: Re: After Trigger assignment to NEW
Previous:From: Achilleus MantziosDate: 2006-02-24 16:44:08
Subject: After Trigger assignment to NEW

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group