Re: Recursion in triggers?
От | Tom Lane |
---|---|
Тема | Re: Recursion in triggers? |
Дата | |
Msg-id | 12479.1264361664@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Re: Recursion in triggers? ("Gauthier, Dave" <dave.gauthier@intel.com>) |
Список | pgsql-general |
"Gauthier, Dave" <dave.gauthier@intel.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 updateon the same table, but on record B. That second execution of the update trigger needs to see the mods made to recordA. 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
В списке pgsql-general по дате отправления: