]> granicus.if.org Git - postgresql/blob - doc/src/sgml/ref/abort.sgml
Add support for piping COPY to/from an external program.
[postgresql] / doc / src / sgml / ref / abort.sgml
1 <!--
2 doc/src/sgml/ref/abort.sgml
3 PostgreSQL documentation
4 -->
5
6 <refentry id="SQL-ABORT">
7  <refmeta>
8   <refentrytitle>ABORT</refentrytitle>
9   <manvolnum>7</manvolnum>
10   <refmiscinfo>SQL - Language Statements</refmiscinfo>
11  </refmeta>
12
13  <refnamediv>
14   <refname>ABORT</refname>
15   <refpurpose>abort the current transaction</refpurpose>
16  </refnamediv>
17
18  <indexterm zone="sql-abort">
19   <primary>ABORT</primary>
20  </indexterm>
21
22  <refsynopsisdiv>
23 <synopsis>
24 ABORT [ WORK | TRANSACTION ]
25 </synopsis>
26  </refsynopsisdiv>
27
28  <refsect1>
29   <title>Description</title>
30
31   <para>
32    <command>ABORT</command> rolls back the current transaction and causes
33    all the updates made by the transaction to be discarded.
34    This command is identical
35    in behavior to the standard <acronym>SQL</acronym> command
36    <xref linkend="SQL-ROLLBACK">,
37    and is present only for historical reasons.
38   </para>
39  </refsect1>
40
41  <refsect1>
42   <title>Parameters</title>
43
44   <variablelist>
45    <varlistentry>
46     <term><literal>WORK</literal></term>
47     <term><literal>TRANSACTION</literal></term>
48     <listitem>
49      <para>
50       Optional key words. They have no effect.
51      </para>
52     </listitem>
53    </varlistentry>
54   </variablelist>
55  </refsect1>
56
57  <refsect1>
58   <title>Notes</title>
59
60   <para>
61    Use <xref linkend="SQL-COMMIT"> to
62    successfully terminate a transaction.
63   </para>
64
65   <para>
66    Issuing <command>ABORT</> when not inside a transaction does
67    no harm, but it will provoke a warning message.
68   </para>
69  </refsect1>
70
71  <refsect1>
72   <title>Examples</title>
73
74   <para>
75    To abort all changes:
76 <programlisting>
77 ABORT;
78 </programlisting></para>
79  </refsect1>
80
81  <refsect1>
82   <title>Compatibility</title>
83
84   <para>
85    This command is a <productname>PostgreSQL</productname> extension
86    present for historical reasons. <command>ROLLBACK</command> is the
87    equivalent standard SQL command.
88   </para>
89  </refsect1>
90
91  <refsect1>
92   <title>See Also</title>
93
94   <simplelist type="inline">
95    <member><xref linkend="sql-begin"></member>
96    <member><xref linkend="sql-commit"></member>
97    <member><xref linkend="sql-rollback"></member>
98   </simplelist>
99  </refsect1>
100 </refentry>