简体   繁体   中英

what happens to after trigger actions, when a table fails in insert actions that trigger these trigger functions?

When I insert a row into a table X, then it will trigger another trigger function to insert a row into another table Y.

But if the first insert fails, then what happens to the other trigger functions?
Do these trigger functions work or not?
I want to ask this for before trigger too?
If the before trigger on X table fails while inserting a row into table Y, then does the insert into table X work or not?

Anything the trigger does runs in the same transaction as the statement that caused the trigger to fire. If the "calling transaction" gets rolled back, so does any change done by the trigger.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM