2 doc/src/sgml/ref/release_savepoint.sgml
3 PostgreSQL documentation
6 <refentry id="SQL-RELEASE-SAVEPOINT">
8 <refentrytitle>RELEASE SAVEPOINT</refentrytitle>
9 <manvolnum>7</manvolnum>
10 <refmiscinfo>SQL - Language Statements</refmiscinfo>
14 <refname>RELEASE SAVEPOINT</refname>
15 <refpurpose>destroy a previously defined savepoint</refpurpose>
18 <indexterm zone="sql-release-savepoint">
19 <primary>RELEASE SAVEPOINT</primary>
22 <indexterm zone="sql-release-savepoint">
23 <primary>savepoints</primary>
24 <secondary>releasing</secondary>
29 RELEASE [ SAVEPOINT ] <replaceable>savepoint_name</replaceable>
34 <title>Description</title>
37 <command>RELEASE SAVEPOINT</command> destroys a savepoint previously defined
38 in the current transaction.
42 Destroying a savepoint makes it unavailable as a rollback point,
43 but it has no other user visible behavior. It does not undo the
44 effects of commands executed after the savepoint was established.
45 (To do that, see <xref linkend="sql-rollback-to">.)
46 Destroying a savepoint when
47 it is no longer needed allows the system to reclaim some resources
48 earlier than transaction end.
52 <command>RELEASE SAVEPOINT</command> also destroys all savepoints that were
53 established after the named savepoint was established.
58 <title>Parameters</title>
62 <term><replaceable>savepoint_name</replaceable></term>
65 The name of the savepoint to destroy.
76 Specifying a savepoint name that was not previously defined is an error.
80 It is not possible to release a savepoint when the transaction is in
85 If multiple savepoints have the same name, only the one that was most
86 recently defined is released.
92 <title>Examples</title>
95 To establish and later destroy a savepoint:
98 INSERT INTO table1 VALUES (3);
99 SAVEPOINT my_savepoint;
100 INSERT INTO table1 VALUES (4);
101 RELEASE SAVEPOINT my_savepoint;
104 The above transaction will insert both 3 and 4.
109 <title>Compatibility</title>
112 This command conforms to the <acronym>SQL</> standard. The standard
113 specifies that the key word <literal>SAVEPOINT</literal> is
114 mandatory, but <productname>PostgreSQL</productname> allows it to
120 <title>See Also</title>
122 <simplelist type="inline">
123 <member><xref linkend="sql-begin"></member>
124 <member><xref linkend="sql-commit"></member>
125 <member><xref linkend="sql-rollback"></member>
126 <member><xref linkend="sql-rollback-to"></member>
127 <member><xref linkend="sql-savepoint"></member>