I have a trigger BEFORE DELETEthat inserts rows into another table with SPI_exec.
BEFORE DELETE
SPI_exec
Are these requests INSERTexecuted in the same transaction as in the case when the initial deletion is performed? Consequently, are all inserts removed or fixed together?
INSERT
If not, how can I do this?
Yes, all triggers are in the same transaction as the triggering event.
Not directly related to the issue, but usually you want to put side effects in the trigger AFTER, not the trigger BEFORE.
AFTER
BEFORE