From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | "Gauthier, Dave" <dave(dot)gauthier(at)intel(dot)com> |
Cc: | Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: Recursion in triggers? |
Date: | 2010-01-24 19:34:24 |
Message-ID: | 12479.1264361664@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
"Gauthier, Dave" <dave(dot)gauthier(at)intel(dot)com> writes:
> Ya, I worded the original poorley. Let me try again....
> The after update trigger on the table sets some of the NEW.column values for record A. Then it executes another update on the same table, but on record B. That second execution of the update trigger needs to see the mods made to record A.
Changing NEW in an after trigger has no effect outside the trigger
function itself. It's too late to affect the data that went into the
table --- that's more or less the whole point of AFTER vs BEFORE
triggers.
However, once you get that issue straightened out, it is true that
triggers fired pursuant to the UPDATE inside the first trigger will
also see whatever data changes the first trigger saw. See
http://www.postgresql.org/docs/8.4/static/trigger-datachanges.html
regards, tom lane
From | Date | Subject | |
---|---|---|---|
Next Message | Alessandro Agosto | 2010-01-24 22:32:07 | Fwd: [LibPQ] Trying PQconnectStart: it doesn't seem to connect |
Previous Message | John R Pierce | 2010-01-24 19:23:22 | Re: port question |