~ubuntu-branches/ubuntu/hardy/postgresql-8.4/hardy-backports

« back to all changes in this revision

Viewing changes to doc/src/sgml/ref/commit_prepared.sgml

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2009-03-20 12:00:13 UTC
  • Revision ID: james.westby@ubuntu.com-20090320120013-hogj7egc5mjncc5g
Tags: upstream-8.4~0cvs20090328
ImportĀ upstreamĀ versionĀ 8.4~0cvs20090328

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<!--
 
2
$PostgreSQL$
 
3
PostgreSQL documentation
 
4
-->
 
5
 
 
6
<refentry id="SQL-COMMIT-PREPARED">
 
7
 <refmeta>
 
8
  <refentrytitle id="sql-commit-prepared-title">COMMIT PREPARED</refentrytitle>
 
9
  <manvolnum>7</manvolnum>
 
10
  <refmiscinfo>SQL - Language Statements</refmiscinfo>
 
11
 </refmeta>
 
12
 
 
13
 <refnamediv>
 
14
  <refname>COMMIT PREPARED</refname>
 
15
  <refpurpose>commit a transaction that was earlier prepared for two-phase commit</refpurpose>
 
16
 </refnamediv>
 
17
 
 
18
 <indexterm zone="sql-commit-prepared">
 
19
  <primary>COMMIT PREPARED</primary>
 
20
 </indexterm>
 
21
 
 
22
 <refsynopsisdiv>
 
23
<synopsis>
 
24
COMMIT PREPARED <replaceable class="PARAMETER">transaction_id</replaceable>
 
25
</synopsis>
 
26
 </refsynopsisdiv>
 
27
 
 
28
 <refsect1>
 
29
  <title>Description</title>
 
30
 
 
31
  <para>
 
32
   <command>COMMIT PREPARED</command> commits a transaction that is in 
 
33
   prepared state.
 
34
  </para>
 
35
 </refsect1>
 
36
 
 
37
 <refsect1>
 
38
  <title>Parameters</title>
 
39
 
 
40
  <variablelist>
 
41
   <varlistentry>
 
42
    <term><replaceable class="PARAMETER">transaction_id</replaceable></term>
 
43
    <listitem>
 
44
     <para>
 
45
      The transaction identifier of the transaction that is to be
 
46
      committed.
 
47
     </para>
 
48
    </listitem>
 
49
   </varlistentry>
 
50
  </variablelist>
 
51
 </refsect1>
 
52
 
 
53
 <refsect1>
 
54
  <title>Notes</title>
 
55
 
 
56
  <para>
 
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.
 
60
  </para>
 
61
 
 
62
  <para>
 
63
   This command cannot be executed inside a transaction block. The prepared
 
64
   transaction is committed immediately.
 
65
  </para>
 
66
 
 
67
  <para>
 
68
   All currently available prepared transactions are listed in the
 
69
   <link linkend="view-pg-prepared-xacts"><structname>pg_prepared_xacts</structname></link>
 
70
   system view.
 
71
  </para>
 
72
 </refsect1>
 
73
 
 
74
 <refsect1 id="sql-commit-prepared-examples">
 
75
  <title id="sql-commit-prepared-examples-title">Examples</title>
 
76
  <para>
 
77
   Commit the transaction identified by the transaction
 
78
   identifier <literal>foobar</>:
 
79
   
 
80
<programlisting>
 
81
COMMIT PREPARED 'foobar';
 
82
</programlisting>
 
83
  </para>
 
84
 
 
85
 </refsect1>
 
86
 
 
87
 <refsect1>
 
88
  <title>See Also</title>
 
89
 
 
90
  <simplelist type="inline">
 
91
   <member><xref linkend="sql-prepare-transaction" endterm="sql-prepare-transaction-title"></member>
 
92
   <member><xref linkend="sql-rollback-prepared" endterm="sql-rollback-prepared-title"></member>
 
93
  </simplelist>
 
94
 </refsect1>
 
95
 
 
96
</refentry>