## Chapter 16. Autonomous Transactions

## 16.1. Overview

Postgres Pro supports nested transactions: they are rarely explicitly used by programmer and mostly used for error handling and stored procedures. It is possible to rollback a subtransaction without affecting the parent transaction. But commit of a subtraction is delayed until commit of parent transaction.

However, in some cases applications need to run several independent transactions inside a single transaction — “autonomous transactions”. Autonomous transactions are needed mostly for implementing audits, when the fact of performing an audit should be reported regardless of the status of the audit itself: whether it was successfully completed or not.