1ROLLBACK(7)              PostgreSQL 12.6 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 transaction is immediately started
22           with the same transaction characteristics (see SET TRANSACTION
23           (SET_TRANSACTION(7))) as the just finished one. Otherwise, no new
24           transaction is started.
25

NOTES

27       Use COMMIT(7) 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 12.6                      2021                          ROLLBACK(7)
Impressum