commit and rollback
PostgreSQL in Production notes about commit and rollback
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.

