2 doc/src/sgml/ref/commit_prepared.sgml
3 PostgreSQL documentation
6 <refentry id="SQL-COMMIT-PREPARED">
7 <indexterm zone="sql-commit-prepared">
8 <primary>COMMIT PREPARED</primary>
12 <refentrytitle>COMMIT PREPARED</refentrytitle>
13 <manvolnum>7</manvolnum>
14 <refmiscinfo>SQL - Language Statements</refmiscinfo>
18 <refname>COMMIT PREPARED</refname>
19 <refpurpose>commit a transaction that was earlier prepared for two-phase commit</refpurpose>
24 COMMIT PREPARED <replaceable class="PARAMETER">transaction_id</replaceable>
29 <title>Description</title>
32 <command>COMMIT PREPARED</command> commits 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 commit 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 committed 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-commit-prepared-examples">
75 <title id="sql-commit-prepared-examples-title">Examples</title>
77 Commit the transaction identified by the transaction
78 identifier <literal>foobar</>:
81 COMMIT PREPARED 'foobar';
82 </programlisting></para>
87 <title>Compatibility</title>
90 <command>COMMIT PREPARED</command> is a
91 <productname>PostgreSQL</productname> extension. It is intended for use by
92 external transaction management systems, some of which are covered by
93 standards (such as X/Open XA), but the SQL side of those systems is not
99 <title>See Also</title>
101 <simplelist type="inline">
102 <member><xref linkend="sql-prepare-transaction"></member>
103 <member><xref linkend="sql-rollback-prepared"></member>