Manage transactions and concurrency
PostgreSQL in Production notes about Manage transactions and concurrency
Manage transactions and concurrency
Where Should an Application Put BEGIN, COMMIT, and ROLLBACK?
Put one transaction around the related SQL changes, inspect the result before committing, and roll back the whole unit when a statement or business check fails.

