commit.sgml 2.5 KB
Newer Older
1
<!--
T
Tom Lane 已提交
2
$Header: /cvsroot/pgsql/doc/src/sgml/ref/commit.sgml,v 1.18 2003/09/12 00:12:47 tgl Exp $
3
PostgreSQL documentation
4 5
-->

T
Thomas G. Lockhart 已提交
6 7
<refentry id="SQL-COMMIT">
 <refmeta>
8
  <refentrytitle id="SQL-COMMIT-TITLE">COMMIT</refentrytitle>
T
Thomas G. Lockhart 已提交
9 10
  <refmiscinfo>SQL - Language Statements</refmiscinfo>
 </refmeta>
11

T
Thomas G. Lockhart 已提交
12
 <refnamediv>
13 14
  <refname>COMMIT</refname>
  <refpurpose>commit the current transaction</refpurpose>
T
Tom Lane 已提交
15 16
 </refnamediv>

P
Peter Eisentraut 已提交
17 18 19 20
 <indexterm zone="sql-commit">
  <primary>COMMIT</primary>
 </indexterm>

T
Thomas G. Lockhart 已提交
21
 <refsynopsisdiv>
22
<synopsis>
23
COMMIT [ WORK | TRANSACTION ]
24
</synopsis>
T
Thomas G. Lockhart 已提交
25
 </refsynopsisdiv>
26
  
27 28 29
 <refsect1>
  <title>Description</title>

T
Thomas G. Lockhart 已提交
30
  <para>
31
   <command>COMMIT</command> commits the current transaction. All
32 33
   changes made by the transaction become visible to others
   and are guaranteed to be durable if a crash occurs.
T
Thomas G. Lockhart 已提交
34
  </para>
35
 </refsect1>
36
  
37 38
 <refsect1>
  <title>Parameters</title>
T
Thomas G. Lockhart 已提交
39

40 41 42 43 44 45 46 47 48 49 50
  <variablelist>
   <varlistentry>
    <term><literal>WORK</literal></term>
    <term><literal>TRANSACTION</literal></term>
    <listitem>
     <para>
      Optional key words. They have no effect.
     </para>
    </listitem>
   </varlistentry>
  </variablelist>
51
 </refsect1>
52 53 54

 <refsect1>
  <title>Notes</title>
55

T
Thomas G. Lockhart 已提交
56
  <para>
57 58 59
   Use <xref linkend="SQL-ROLLBACK" endterm="SQL-ROLLBACK-TITLE"> to
   abort a transaction.
  </para>
60 61 62 63 64

  <para>
   Issuing <command>COMMIT</> when not inside a transaction does
   no harm, but it will provoke a warning message.
  </para>
65 66 67 68 69 70 71 72 73 74
 </refsect1>

 <refsect1>
  <title>Examples</title>

  <para>
   To commit the current transaction and make all changes permanent:
<programlisting>
COMMIT;
</programlisting>
T
Thomas G. Lockhart 已提交
75 76
  </para>
 </refsect1>
T
Tom Lane 已提交
77

78 79
 <refsect1>
  <title>Compatibility</title>
80
  
81 82 83 84 85
  <para>
   The SQL standard only specifies the two forms
   <literal>COMMIT</literal> and <literal>COMMIT
   WORK</literal>. Otherwise, this command is fully conforming.
  </para>
86
 </refsect1>
87 88 89 90 91 92 93 94 95

 <refsect1>
  <title>See Also</title>

  <simplelist type="inline">
   <member><xref linkend="sql-begin" endterm="sql-begin-title"></member>
   <member><xref linkend="sql-rollback" endterm="sql-rollback-title"></member>
  </simplelist>
 </refsect1>
T
Thomas G. Lockhart 已提交
96
</refentry>
97 98 99 100

<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
T
Thomas G. Lockhart 已提交
101
sgml-omittag:nil
102 103 104 105 106 107 108 109 110 111 112 113
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"../reference.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:"/usr/lib/sgml/catalog"
sgml-local-ecat-files:nil
End:
-->