ROLLBACK v16

Name

ROLLBACK  Abort the current transaction.

Synopsis

ROLLBACK [ WORK ]

Description

ROLLBACK rolls back the current transaction and discards all the updates made by the transaction.

Parameters

WORK

Optional keyword that has no effect.

Notes

Use COMMIT to successfully terminate a transaction.

Issuing ROLLBACK when not inside a transaction does no harm.

Note

Executing a ROLLBACK in a plpgsql procedure throws an error if there's an Oracle-style SPL procedure on the runtime stack.

Examples

Abort all changes:

ROLLBACK;

See also

COMMIT, ROLLBACK TO SAVEPOINT, SAVEPOINT