Search Postgresql Archives

Re: Recursion in triggers?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Gauthier, Dave" <dave.gauthier@xxxxxxxxx> 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

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux