]> begriffs open source - ai-pg/blob - full-docs/txt/sql-rollback.txt
Convert HTML docs to more streamlined TXT
[ai-pg] / full-docs / txt / sql-rollback.txt
1
2 ROLLBACK
3
4    ROLLBACK — abort the current transaction
5
6 Synopsis
7
8 ROLLBACK [ WORK | TRANSACTION ] [ AND [ NO ] CHAIN ]
9
10 Description
11
12    ROLLBACK rolls back the current transaction and causes all the updates
13    made by the transaction to be discarded.
14
15 Parameters
16
17    WORK
18           TRANSACTION #
19           Optional key words. They have no effect.
20
21    AND CHAIN #
22           If AND CHAIN is specified, a new (not aborted) transaction is
23           immediately started with the same transaction characteristics
24           (see SET TRANSACTION) as the just finished one. Otherwise, no
25           new transaction is started.
26
27 Notes
28
29    Use COMMIT to successfully terminate a transaction.
30
31    Issuing ROLLBACK outside of a transaction block emits a warning and
32    otherwise has no effect. ROLLBACK AND CHAIN outside of a transaction
33    block is an error.
34
35 Examples
36
37    To abort all changes:
38 ROLLBACK;
39
40 Compatibility
41
42    The command ROLLBACK conforms to the SQL standard. The form ROLLBACK
43    TRANSACTION is a PostgreSQL extension.
44
45 See Also
46
47    BEGIN, COMMIT, ROLLBACK TO SAVEPOINT