]> begriffs open source - ai-pg/blob - full-docs/man7/ABORT.7
Include links to all subsection html pages, with shorter paths too
[ai-pg] / full-docs / man7 / ABORT.7
1 '\" t
2 .\"     Title: ABORT
3 .\"    Author: The PostgreSQL Global Development Group
4 .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
5 .\"      Date: 2025
6 .\"    Manual: PostgreSQL 18.0 Documentation
7 .\"    Source: PostgreSQL 18.0
8 .\"  Language: English
9 .\"
10 .TH "ABORT" "7" "2025" "PostgreSQL 18.0" "PostgreSQL 18.0 Documentation"
11 .\" -----------------------------------------------------------------
12 .\" * Define some portability stuff
13 .\" -----------------------------------------------------------------
14 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15 .\" http://bugs.debian.org/507673
16 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
18 .ie \n(.g .ds Aq \(aq
19 .el       .ds Aq '
20 .\" -----------------------------------------------------------------
21 .\" * set default formatting
22 .\" -----------------------------------------------------------------
23 .\" disable hyphenation
24 .nh
25 .\" disable justification (adjust text to left margin only)
26 .ad l
27 .\" -----------------------------------------------------------------
28 .\" * MAIN CONTENT STARTS HERE *
29 .\" -----------------------------------------------------------------
30 .SH "NAME"
31 ABORT \- abort the current transaction
32 .SH "SYNOPSIS"
33 .sp
34 .nf
35 ABORT [ WORK | TRANSACTION ] [ AND [ NO ] CHAIN ]
36 .fi
37 .SH "DESCRIPTION"
38 .PP
39 \fBABORT\fR
40 rolls back the current transaction and causes all the updates made by the transaction to be discarded\&. This command is identical in behavior to the standard
41 SQL
42 command
43 \fBROLLBACK\fR, and is present only for historical reasons\&.
44 .SH "PARAMETERS"
45 .PP
46 WORK
47 .br
48 TRANSACTION
49 .RS 4
50 Optional key words\&. They have no effect\&.
51 .RE
52 .PP
53 AND CHAIN
54 .RS 4
55 If
56 AND CHAIN
57 is specified, a new transaction is immediately started with the same transaction characteristics (see
58 \fBSET TRANSACTION\fR) as the just finished one\&. Otherwise, no new transaction is started\&.
59 .RE
60 .SH "NOTES"
61 .PP
62 Use
63 \fBCOMMIT\fR
64 to successfully terminate a transaction\&.
65 .PP
66 Issuing
67 \fBABORT\fR
68 outside of a transaction block emits a warning and otherwise has no effect\&.
69 .SH "EXAMPLES"
70 .PP
71 To abort all changes:
72 .sp
73 .if n \{\
74 .RS 4
75 .\}
76 .nf
77 ABORT;
78 .fi
79 .if n \{\
80 .RE
81 .\}
82 .SH "COMPATIBILITY"
83 .PP
84 This command is a
85 PostgreSQL
86 extension present for historical reasons\&.
87 \fBROLLBACK\fR
88 is the equivalent standard SQL command\&.
89 .SH "SEE ALSO"
90 \fBBEGIN\fR(7), \fBCOMMIT\fR(7), \fBROLLBACK\fR(7)