Rolls back the current transaction.
Syntax
ROLLBACK [ WORK ]
Description
You can use the ROLLBACK
command to roll back the current transaction and discard all the updates made by
the transaction.
Parameters
Parameter | Description |
---|
Parameter | Description |
---|---|
WORK | An optional keyword, which has no effect. |
Notes
You can use the COMMIT
command to end a transaction.
If you run ROLLBACK
at a time point which is not in a transaction, no changes are made.
ROLLBACK
command in a PL/pgSQL procedure.
Examples
Roll back all changes:
ROLLBACK;