The code to unlink dropped relations in FinishPreparedTransaction() was
[PostgreSQL.git] / doc / src / sgml / ref / abort.sgml
blob402c871f15f307e43da7a49d32d2919e197acffe
1 <!--
2 $PostgreSQL$
3 PostgreSQL documentation
4 -->
6 <refentry id="SQL-ABORT">
7 <refmeta>
8 <refentrytitle id="sql-abort-title">ABORT</refentrytitle>
9 <manvolnum>7</manvolnum>
10 <refmiscinfo>SQL - Language Statements</refmiscinfo>
11 </refmeta>
13 <refnamediv>
14 <refname>ABORT</refname>
15 <refpurpose>abort the current transaction</refpurpose>
16 </refnamediv>
18 <indexterm zone="sql-abort">
19 <primary>ABORT</primary>
20 </indexterm>
22 <refsynopsisdiv>
23 <synopsis>
24 ABORT [ WORK | TRANSACTION ]
25 </synopsis>
26 </refsynopsisdiv>
28 <refsect1>
29 <title>Description</title>
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" endterm="SQL-ROLLBACK-TITLE">,
37 and is present only for historical reasons.
38 </para>
39 </refsect1>
41 <refsect1>
42 <title>Parameters</title>
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>
57 <refsect1>
58 <title>Notes</title>
60 <para>
61 Use <xref linkend="SQL-COMMIT" endterm="SQL-COMMIT-TITLE"> to
62 successfully terminate a transaction.
63 </para>
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>
71 <refsect1>
72 <title>Examples</title>
74 <para>
75 To abort all changes:
76 <programlisting>
77 ABORT;
78 </programlisting>
79 </para>
80 </refsect1>
82 <refsect1>
83 <title>Compatibility</title>
85 <para>
86 This command is a <productname>PostgreSQL</productname> extension
87 present for historical reasons. <command>ROLLBACK</command> is the
88 equivalent standard SQL command.
89 </para>
90 </refsect1>
92 <refsect1>
93 <title>See Also</title>
95 <simplelist type="inline">
96 <member><xref linkend="sql-begin" endterm="sql-begin-title"></member>
97 <member><xref linkend="sql-commit" endterm="sql-commit-title"></member>
98 <member><xref linkend="sql-rollback" endterm="sql-rollback-title"></member>
99 </simplelist>
100 </refsect1>
101 </refentry>