All PostgreSQL triggers are executed in the same transaction as the transaction that caused them.
Change You can also use LISTEN
+ NOTIFY
to send a message from your trigger to code that runs outside of the transaction. In this case, the message will be delivered only at the time of a successful commit. Errors in listeners will not roll back the transaction operation.
source share