commit.sgml 3.32 KB
Newer Older
1
<!--
2
$Header: /cvsroot/pgsql/doc/src/sgml/ref/commit.sgml,v 1.13 2002/03/06 06:48:03 momjian Exp $
3
PostgreSQL documentation
4 5
-->

6 7 8
<refentry id="SQL-COMMIT">
 <refmeta>
  <refentrytitle id="SQL-COMMIT-TITLE">
9
   COMMIT
10 11 12 13 14
  </refentrytitle>
  <refmiscinfo>SQL - Language Statements</refmiscinfo>
 </refmeta>
 <refnamediv>
  <refname>
15
   COMMIT
16 17
  </refname>
  <refpurpose>
18
   commit the current transaction
19
  </refpurpose>
20
 </refnamediv>  
21
  
22 23
 <refsynopsisdiv>
  <refsynopsisdivinfo>
24
   <date>1999-07-20</date>
25 26
  </refsynopsisdivinfo>
  <synopsis>
27
COMMIT [ WORK | TRANSACTION ]
28
  </synopsis>
29
  
30 31 32 33 34
  <refsect2 id="R2-SQL-COMMIT-1">
   <refsect2info>
    <date>1998-09-08</date>
   </refsect2info>
   <title>
35
    Inputs
36 37
   </title>
   <para>
38 39 40 41 42 43 44 45 46 47 48 49

    <variablelist>
     <varlistentry>
      <term>WORK</term>
      <term>TRANSACTION</term>
      <listitem>
       <para>
	Optional keywords. They have no effect.
       </para>
      </listitem>
     </varlistentry>
    </variablelist>
50
   </para>
51
  </refsect2>
52
   
53 54 55 56 57
  <refsect2 id="R2-SQL-COMMIT-2">
   <refsect2info>
    <date>1998-09-08</date>
   </refsect2info>
   <title>
58
    Outputs
59 60
   </title>
   <para>
61

62 63
    <variablelist>
     <varlistentry>
64
      <term><computeroutput>
65
COMMIT
66
       </computeroutput></term>
67 68 69 70 71 72 73
      <listitem>
       <para>
	Message returned if the transaction is successfully committed.
       </para>
      </listitem>
     </varlistentry>
     <varlistentry>
74
      <term><computeroutput>
75
WARNING:  COMMIT: no transaction in progress
76
       </computeroutput></term>
77 78
      <listitem>
       <para>
79 80 81 82
	If there is no transaction in progress.
       </para>
      </listitem>
     </varlistentry>
83
    </variablelist>
84
   </para>
85 86
  </refsect2>
 </refsynopsisdiv>
87
  
88 89 90 91 92
 <refsect1 id="R1-SQL-COMMIT-1">
  <refsect1info>
   <date>1998-09-08</date>
  </refsect1info>
  <title>
93
   Description
94 95
  </title>
  <para>
96
   <command>COMMIT</command> commits the current transaction. All
97 98
   changes made by the transaction become visible to others
   and are guaranteed to be durable if a crash occurs.
99
  </para>
100
  
101 102 103 104 105
  <refsect2 id="R2-SQL-COMMIT-3">
   <refsect2info>
    <date>1998-09-08</date>
   </refsect2info>
   <title>
106
    Notes
107 108
   </title>
   <para>
109
    The keywords WORK and TRANSACTION are noise and can be omitted.
110 111
   </para>

112
   <para>
113
    Use <xref linkend="SQL-ROLLBACK" endterm="SQL-ROLLBACK-TITLE">
114
    to abort a transaction.
115
   </para>
116
  </refsect2>
117 118
 </refsect1>

119 120
 <refsect1 id="R1-SQL-COMMIT-2">
  <title>
121
   Usage
122 123 124 125
  </title>
  <para>
   To make all changes permanent:
   <programlisting>
126
COMMIT WORK;
127 128 129
   </programlisting>
  </para>
 </refsect1>
130
 
131 132
 <refsect1 id="R1-SQL-COMMIT-3">
  <title>
133
   Compatibility
134
  </title>
135
  
136 137 138 139 140
  <refsect2 id="R2-SQL-COMMIT-4">
   <refsect2info>
    <date>1998-09-08</date>
   </refsect2info>
   <title>
141
    SQL92
142 143
   </title>
   <para>
144 145
    <acronym>SQL92</acronym> only specifies the two forms <literal>COMMIT</literal>
    and <literal>COMMIT WORK</literal>. Otherwise full compatibility.
146
   </para>
147 148
  </refsect2>
 </refsect1>
149
</refentry>
150 151 152 153

<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
154
sgml-omittag:nil
155 156 157 158 159 160 161 162 163 164 165 166
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:
-->