pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Achilleus Mantzios <achill@matrix.gatewaynet.com>
To: pgsql-sql@postgresql.org
Subject: After Trigger assignment to NEW
Date: Fri, 24 Feb 2006 18:44:08 +0200 (EET)
Message-ID: <Pine.LNX.4.44.0602241831280.19738-100000@matrix.gatewaynet.com> (raw)


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




view thread (9+ messages)  latest in thread

Message-ID: <Pine.LNX.4.44.0602241831280.19738-100000@matrix.gatewaynet.com>
Permalink:  ../Pine.LNX.4.44.0602241831280.19738-100000@matrix.gatewaynet.com/
Also on:    postgresql.org/message-id/Pine.LNX.4.44.0602241831280.19738-100000@matrix.gatewaynet.com

 · 

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: achill@matrix.gatewaynet.com
  Subject: Re: After Trigger assignment to NEW
  In-Reply-To: <Pine.LNX.4.44.0602241831280.19738-100000@matrix.gatewaynet.com>

* 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