3 PostgreSQL documentation
6 <refentry id=
"SQL-ROLLBACK">
8 <refentrytitle id=
"SQL-ROLLBACK-TITLE">ROLLBACK
</refentrytitle>
9 <manvolnum>7</manvolnum>
10 <refmiscinfo>SQL - Language Statements
</refmiscinfo>
14 <refname>ROLLBACK
</refname>
15 <refpurpose>abort the current transaction
</refpurpose>
18 <indexterm zone=
"sql-rollback">
19 <primary>ROLLBACK
</primary>
24 ROLLBACK [ WORK | TRANSACTION ]
29 <title>Description
</title>
32 <command>ROLLBACK
</command> rolls back the current transaction and causes
33 all the updates made by the transaction to be discarded.
38 <title>Parameters
</title>
42 <term><literal>WORK
</literal></term>
43 <term><literal>TRANSACTION
</literal></term>
46 Optional key words. They have no effect.
57 Use
<xref linkend=
"SQL-COMMIT" endterm=
"SQL-COMMIT-TITLE"> to
58 successfully terminate a transaction.
62 Issuing
<command>ROLLBACK<
/> when not inside a transaction does
63 no harm, but it will provoke a warning message.
68 <title>Examples
</title>
79 <title>Compatibility
</title>
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.
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>