Make LC_COLLATE and LC_CTYPE database-level settings. Collation and
[PostgreSQL.git] / doc / src / sgml / ref / rollback.sgml
blobcef20b493ab8a9d20bda9c3797132a581134d19e
1 <!--
2 $PostgreSQL$
3 PostgreSQL documentation
4 -->
6 <refentry id="SQL-ROLLBACK">
7 <refmeta>
8 <refentrytitle id="SQL-ROLLBACK-TITLE">ROLLBACK</refentrytitle>
9 <refmiscinfo>SQL - Language Statements</refmiscinfo>
10 </refmeta>
12 <refnamediv>
13 <refname>ROLLBACK</refname>
14 <refpurpose>abort the current transaction</refpurpose>
15 </refnamediv>
17 <indexterm zone="sql-rollback">
18 <primary>ROLLBACK</primary>
19 </indexterm>
21 <refsynopsisdiv>
22 <synopsis>
23 ROLLBACK [ WORK | TRANSACTION ]
24 </synopsis>
25 </refsynopsisdiv>
27 <refsect1>
28 <title>Description</title>
30 <para>
31 <command>ROLLBACK</command> rolls back the current transaction and causes
32 all the updates made by the transaction to be discarded.
33 </para>
34 </refsect1>
36 <refsect1>
37 <title>Parameters</title>
39 <variablelist>
40 <varlistentry>
41 <term><literal>WORK</literal></term>
42 <term><literal>TRANSACTION</literal></term>
43 <listitem>
44 <para>
45 Optional key words. They have no effect.
46 </para>
47 </listitem>
48 </varlistentry>
49 </variablelist>
50 </refsect1>
52 <refsect1>
53 <title>Notes</title>
55 <para>
56 Use <xref linkend="SQL-COMMIT" endterm="SQL-COMMIT-TITLE"> to
57 successfully terminate a transaction.
58 </para>
60 <para>
61 Issuing <command>ROLLBACK</> when not inside a transaction does
62 no harm, but it will provoke a warning message.
63 </para>
64 </refsect1>
66 <refsect1>
67 <title>Examples</title>
69 <para>
70 To abort all changes:
71 <programlisting>
72 ROLLBACK;
73 </programlisting>
74 </para>
75 </refsect1>
77 <refsect1>
78 <title>Compatibility</title>
80 <para>
81 The SQL standard only specifies the two forms
82 <literal>ROLLBACK</literal> and <literal>ROLLBACK
83 WORK</literal>. Otherwise, this command is fully conforming.
84 </para>
85 </refsect1>
87 <refsect1>
88 <title>See Also</title>
90 <simplelist type="inline">
91 <member><xref linkend="sql-begin" endterm="sql-begin-title"></member>
92 <member><xref linkend="sql-commit" endterm="sql-commit-title"></member>
93 <member><xref linkend="sql-rollback-to" endterm="sql-rollback-to-title"></member>
94 </simplelist>
95 </refsect1>
96 </refentry>