ROLLBACK v13

Name

ROLLBACK -- abort the current transaction.

Synopsis

ROLLBACK [ WORK ]

Description

ROLLBACK rolls back the current transaction and causes all the updates made by the transaction to be discarded.

Parameters

WORK

Optional key word - 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 will throw an error if there is an Oracle-style SPL procedure on the runtime stack.

Examples

To abort all changes:

ROLLBACK;

See Also

COMMIT, ROLLBACK TO SAVEPOINT, SAVEPOINT