16.5. Usage Notes#

16.5. Usage Notes

16.5. Usage Notes #

Autonomous transactions should be used carefully to avoid concurrency issues and deadlocks. They are best suited for bulk operations that can run independently.

Using autonomous transactions disables standard PL/pgSQL exception blocks. Any exceptions will immediately propagate to the main session.

The autonomous worker shares the same database but has its own transaction and snapshot. Reads can observe different data than in the main transaction. Writes are isolated by the separate transaction.

There is a one-time overhead to launch the autonomous worker process. So frequent short transactions may incur significant overhead. Bulk operations will achieve the most performance benefit.