Subject: Trigger definition . . . puzzled
From: tgl@sss.pgh.pa.us (Tom Lane)
Date: 12/13/2007 10:49:32 AM
"Rolf A. de By" <deby@itc.nl> writes:
> Thanks for that. There is some misunderstanding here. For this example,
> I had taken the sting out of my trigger function and turned it into a
> much more concise no-op, with warnings. The actual code of my original
> trigger function is irrelevant. The no-op trigger function displays the
> same strange behaviour: it works as expected for INSERTs, but not for
> UPDATEs. The update goes through! And it shouldn't.
Reading between the lines, I gather you have an inheritance setup and
are expecting a trigger on the parent table to fire for events occurring
in the child tables. Doesn't work like that; you need to put triggers
on the child tables.
regards, tom lane
---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings
Subject: Trigger definition . . . puzzled
From: tgl@sss.pgh.pa.us (Tom Lane)
Date: 12/13/2007 11:33:53 AM
"Rolf A. de By" <deby@itc.nl> writes:
> Yes, this is an inheritance set-up. But actually no: I am executing all
> my data changes against the parent table, and want the trigger on that
> parent table to fire for an insert on the parent table as it does. But
> I also want the trigger to fire when an update on the parent table is
> executed, and this does not happen.
There is no update on any row in the parent table. The update is on a
row in a child table.
regards, tom lane
---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster
|