1ROLLBACK(7)              PostgreSQL 16.1 Documentation             ROLLBACK(7)
2
3
4

NAME

6       ROLLBACK - abort the current transaction
7

SYNOPSIS

9       ROLLBACK [ WORK | TRANSACTION ] [ AND [ NO ] CHAIN ]
10

DESCRIPTION

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

PARAMETERS

16       WORK
17       TRANSACTION
18           Optional key words. They have no effect.
19
20       AND CHAIN
21           If AND CHAIN is specified, a new (not aborted) transaction is
22           immediately started with the same transaction characteristics (see
23           SET TRANSACTION (SET_TRANSACTION(7))) as the just finished one.
24           Otherwise, no new transaction is started.
25

NOTES

27       Use COMMIT to successfully terminate a transaction.
28
29       Issuing ROLLBACK outside of a transaction block emits a warning and
30       otherwise has no effect.  ROLLBACK AND CHAIN outside of a transaction
31       block is an error.
32

EXAMPLES

34       To abort all changes:
35
36           ROLLBACK;
37

COMPATIBILITY

39       The command ROLLBACK conforms to the SQL standard. The form ROLLBACK
40       TRANSACTION is a PostgreSQL extension.
41

SEE ALSO

43       BEGIN(7), COMMIT(7), ROLLBACK TO SAVEPOINT (ROLLBACK_TO_SAVEPOINT(7))
44
45
46
47PostgreSQL 16.1                      2023                          ROLLBACK(7)
Impressum