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

Re: After Trigger assignment to NEW

From: Achilleus Mantzios <achill(at)matrix(dot)gatewaynet(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: After Trigger assignment to NEW
Date: 2006-02-24 19:47:51
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-sql
O Tom Lane έγραψε στις Feb 24, 2006 :

> 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.

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


In response to

pgsql-sql by date

Next:From: Achilleus MantziosDate: 2006-02-24 19:51:24
Subject: Re: After Trigger assignment to NEW
Previous:From: Owen JacobsonDate: 2006-02-24 18:58:25
Subject: Re: After Trigger assignment to NEW

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