If Table A has a BEFORE INSERT
trigger to UPDATE
Table B, do those two operations run in the same transaction? Specifically, if the UPDATE
on Table B fails, does that mean the INSERT
on Table A is rolled back?
1 Answer
Yes
I couldn't find this in the docs at first, but I just found it in Overview of Trigger Behavior.
In all cases, a trigger is executed as part of the same transaction as the statement that triggered it, so if either the statement or the trigger causes an error, the effects of both will be rolled back.