The code to unlink dropped relations in FinishPreparedTransaction() was
[PostgreSQL.git] / doc / src / sgml / ref / rollback.sgml
blobd1fc28c421de13d2d9143009552bd8c8d9c6b57b
1 <!--
2 $PostgreSQL$
3 PostgreSQL documentation
4 -->
6 <refentry id="SQL-ROLLBACK">
7 <refmeta>
8 <refentrytitle id="SQL-ROLLBACK-TITLE">ROLLBACK</refentrytitle>
9 <manvolnum>7</manvolnum>
10 <refmiscinfo>SQL - Language Statements</refmiscinfo>
11 </refmeta>
13 <refnamediv>
14 <refname>ROLLBACK</refname>
15 <refpurpose>abort the current transaction</refpurpose>
16 </refnamediv>
18 <indexterm zone="sql-rollback">
19 <primary>ROLLBACK</primary>
20 </indexterm>
22 <refsynopsisdiv>
23 <synopsis>
24 ROLLBACK [ WORK | TRANSACTION ]
25 </synopsis>
26 </refsynopsisdiv>
28 <refsect1>
29 <title>Description</title>
31 <para>
32 <command>ROLLBACK</command> rolls back the current transaction and causes
33 all the updates made by the transaction to be discarded.
34 </para>
35 </refsect1>
37 <refsect1>
38 <title>Parameters</title>
40 <variablelist>
41 <varlistentry>
42 <term><literal>WORK</literal></term>
43 <term><literal>TRANSACTION</literal></term>
44 <listitem>
45 <para>
46 Optional key words. They have no effect.
47 </para>
48 </listitem>
49 </varlistentry>
50 </variablelist>
51 </refsect1>
53 <refsect1>
54 <title>Notes</title>
56 <para>
57 Use <xref linkend="SQL-COMMIT" endterm="SQL-COMMIT-TITLE"> to
58 successfully terminate a transaction.
59 </para>
61 <para>
62 Issuing <command>ROLLBACK</> when not inside a transaction does
63 no harm, but it will provoke a warning message.
64 </para>
65 </refsect1>
67 <refsect1>
68 <title>Examples</title>
70 <para>
71 To abort all changes:
72 <programlisting>
73 ROLLBACK;
74 </programlisting>
75 </para>
76 </refsect1>
78 <refsect1>
79 <title>Compatibility</title>
81 <para>
82 The SQL standard only specifies the two forms
83 <literal>ROLLBACK</literal> and <literal>ROLLBACK
84 WORK</literal>. Otherwise, this command is fully conforming.
85 </para>
86 </refsect1>
88 <refsect1>
89 <title>See Also</title>
91 <simplelist type="inline">
92 <member><xref linkend="sql-begin" endterm="sql-begin-title"></member>
93 <member><xref linkend="sql-commit" endterm="sql-commit-title"></member>
94 <member><xref linkend="sql-rollback-to" endterm="sql-rollback-to-title"></member>
95 </simplelist>
96 </refsect1>
97 </refentry>