3 PostgreSQL documentation
6 <refentry id=
"SQL-ROLLBACK-PREPARED">
8 <refentrytitle id=
"sql-rollback-prepared-title">ROLLBACK PREPARED
</refentrytitle>
9 <manvolnum>7</manvolnum>
10 <refmiscinfo>SQL - Language Statements
</refmiscinfo>
14 <refname>ROLLBACK PREPARED
</refname>
15 <refpurpose>cancel a transaction that was earlier prepared for two-phase commit
</refpurpose>
18 <indexterm zone=
"sql-rollback-prepared">
19 <primary>ROLLBACK PREPARED
</primary>
24 ROLLBACK PREPARED
<replaceable class=
"PARAMETER">transaction_id
</replaceable>
29 <title>Description
</title>
32 <command>ROLLBACK PREPARED
</command> rolls back a transaction that is in
38 <title>Parameters
</title>
42 <term><replaceable class=
"PARAMETER">transaction_id
</replaceable></term>
45 The transaction identifier of the transaction that is to be
57 To roll back a prepared transaction, you must be either the same user that
58 executed the transaction originally, or a superuser. But you do not
59 have to be in the same session that executed the transaction.
63 This command cannot be executed inside a transaction block. The prepared
64 transaction is rolled back immediately.
68 All currently available prepared transactions are listed in the
69 <link linkend=
"view-pg-prepared-xacts"><structname>pg_prepared_xacts
</structname></link>
74 <refsect1 id=
"sql-rollback-prepared-examples">
75 <title id=
"sql-rollback-prepared-examples-title">Examples
</title>
77 Roll back the transaction identified by the transaction
78 identifier
<literal>foobar<
/>:
81 ROLLBACK PREPARED 'foobar';
88 <title>See Also
</title>
90 <simplelist type=
"inline">
91 <member><xref linkend=
"sql-prepare-transaction" endterm=
"sql-prepare-transaction-title"></member>
92 <member><xref linkend=
"sql-commit-prepared" endterm=
"sql-commit-prepared-title"></member>