Savepoint

Multiple savepoints can exist within a single transaction.

Savepoints are useful for implementing complex error recovery in database applications.

If an error occurs in the midst of a multiple-statement transaction, the application may be able to recover from the error (by rolling back to a savepoint) without needing to abort the entire transaction.

Issuing the commands ROLLBACK or COMMIT will also discard any savepoints created since the start of the main transaction.

Savepoints are defined in the SQL standard and are supported by all established SQL relational databases, including PostgreSQL, Oracle Database, Microsoft SQL Server, MySQL, IBM Db2, SQLite (since 3.6.8), Firebird, H2 Database Engine, and Informix (since version 11.50xC3).