beginnerTransactions — ACID, COMMIT, ROLLBACK, SAVEPOINT

What is the difference between ROLLBACK and ROLLBACK TO SAVEPOINT?

ROLLBACK: undoes ALL changes made in the current transaction since BEGIN. Returns to pre-BEGIN state. Transaction is ended. ROLLBACK TO SAVEPOINT name: undoes changes only SINCE the savepoint was created. The transaction is NOT ended — it remains active and can continue with more statements. The savepoint itself remains (unless RELEASE SAVEPOINT is used). Use case: complex workflows where a sub-st

This is a Pro chapter

Sign in, then upgrade to Pro or Power to unlock this and the full Databases Mastery library.

What is the difference between ROLLBACK and ROLLBACK TO SAVEPOINT?

Next Step

Continue to How does PostgreSQL ensure durability with WAL?← Back to all SQL questions