IT lexicon › Database › Savepoint

Savepoint

Database På svenska → Updated: 2026-07-30

A named point within a transaction that you can roll back to — without aborting the whole transaction. It enables partial undo: "undo only what I've done since savepoint X, but keep the rest". The basis for nested transactions.

Mechanic: SAVEPOINT name sets a marker; ROLLBACK TO SAVEPOINT name undoes everything after it but keeps the transaction alive; RELEASE SAVEPOINT removes the marker. Use case: try a risky operation within a longer transaction and back out just that one on failure; handle an error in one sub-operation without losing all the work; ORMs and drivers use savepoints to emulate "nested transactions" (an inner transaction becomes a savepoint). A SQL standard, supported by PostgreSQL, MySQL/InnoDB, Oracle, SQL Server (with its own syntax). Important in procedures and error handling. Distinct from a full rollback (which aborts everything). Related to distributed transaction and MVCC snapshot.

← Back to the lexicon