]> begriffs open source - ai-pg/blob - full-docs/man7/ROLLBACK_PREPARED.7
Convert HTML docs to more streamlined TXT
[ai-pg] / full-docs / man7 / ROLLBACK_PREPARED.7
1 '\" t
2 .\"     Title: ROLLBACK PREPARED
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 "ROLLBACK PREPARED" "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 ROLLBACK_PREPARED \- cancel a transaction that was earlier prepared for two\-phase commit
32 .SH "SYNOPSIS"
33 .sp
34 .nf
35 ROLLBACK PREPARED \fItransaction_id\fR
36 .fi
37 .SH "DESCRIPTION"
38 .PP
39 \fBROLLBACK PREPARED\fR
40 rolls back a transaction that is in prepared state\&.
41 .SH "PARAMETERS"
42 .PP
43 \fItransaction_id\fR
44 .RS 4
45 The transaction identifier of the transaction that is to be rolled back\&.
46 .RE
47 .SH "NOTES"
48 .PP
49 To roll back a prepared transaction, you must be either the same user that executed the transaction originally, or a superuser\&. But you do not have to be in the same session that executed the transaction\&.
50 .PP
51 This command cannot be executed inside a transaction block\&. The prepared transaction is rolled back immediately\&.
52 .PP
53 All currently available prepared transactions are listed in the
54 pg_prepared_xacts
55 system view\&.
56 .SH "EXAMPLES"
57 .PP
58 Roll back the transaction identified by the transaction identifier
59 foobar:
60 .sp
61 .if n \{\
62 .RS 4
63 .\}
64 .nf
65 ROLLBACK PREPARED \*(Aqfoobar\*(Aq;
66 .fi
67 .if n \{\
68 .RE
69 .\}
70 .SH "COMPATIBILITY"
71 .PP
72 \fBROLLBACK PREPARED\fR
73 is a
74 PostgreSQL
75 extension\&. It is intended for use by external transaction management systems, some of which are covered by standards (such as X/Open XA), but the SQL side of those systems is not standardized\&.
76 .SH "SEE ALSO"
77 PREPARE TRANSACTION (\fBPREPARE_TRANSACTION\fR(7)), COMMIT PREPARED (\fBCOMMIT_PREPARED\fR(7))