After Trigger assignment to NEW

From: Achilleus Mantzios <achill(at)matrix(dot)gatewaynet(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: After Trigger assignment to NEW
Date: 2006-02-24 16:44:08
Message-ID: Pine.LNX.4.44.0602241831280.19738-100000@matrix.gatewaynet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


Hi,

i am currently on 7.4.12, and i what i try to do
is having an AFTER row trigger nullify one NEW column,
so as to prevent a subsequent (AFTER row) trigger from using this column's
data.

Unfortunately this nullification (assignment) does not have
any effect on the next AFTER trigger.

The first trigger is in pl/pgsql, and the second
is in C.

One possible use of the above (if it worked) would be the following.
Suppose the next AFTER triger is the (enhanced version of) dbmirror
trigger which takes care of FK constraints and navigates thru the graph
in order to mirror all depenent tables' rows too.

Suppose there is no need to mirror a specific parent table.
Then in the child table i write an AFTER trigger that nullifies
this columns which is FK to the said parent table, and so prevent
the unwanted traversal from happening in the execution of the next
AFTER trigger (dbmirror).

I'd like to ask, if it is considered the right behaviour
and if there is a plan in changing it.

Is there a reason that the NEW values should remain unchanged in AFTER
row triggers?

--
-Achilleus

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Alvaro Herrera 2006-02-24 17:16:52 Re: After Trigger assignment to NEW
Previous Message Tom Lane 2006-02-24 16:06:02 Re: After Trigger assignment to NEW