2004-08-01 19:32:22 +02:00
|
|
|
<!--
|
2010-04-03 09:23:02 +02:00
|
|
|
$PostgreSQL: pgsql/doc/src/sgml/ref/release_savepoint.sgml,v 1.9 2010/04/03 07:23:02 petere Exp $
|
2004-08-01 19:32:22 +02:00
|
|
|
PostgreSQL documentation
|
|
|
|
-->
|
|
|
|
|
2004-08-12 21:12:21 +02:00
|
|
|
<refentry id="SQL-RELEASE-SAVEPOINT">
|
2004-08-01 19:32:22 +02:00
|
|
|
<refmeta>
|
2010-04-03 09:23:02 +02:00
|
|
|
<refentrytitle>RELEASE SAVEPOINT</refentrytitle>
|
2008-11-14 11:22:48 +01:00
|
|
|
<manvolnum>7</manvolnum>
|
2004-08-01 19:32:22 +02:00
|
|
|
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
|
|
|
</refmeta>
|
|
|
|
|
|
|
|
<refnamediv>
|
2004-08-12 21:12:21 +02:00
|
|
|
<refname>RELEASE SAVEPOINT</refname>
|
2004-08-01 19:32:22 +02:00
|
|
|
<refpurpose>destroy a previously defined savepoint</refpurpose>
|
|
|
|
</refnamediv>
|
|
|
|
|
2004-08-12 21:12:21 +02:00
|
|
|
<indexterm zone="sql-release-savepoint">
|
|
|
|
<primary>RELEASE SAVEPOINT</primary>
|
2004-08-01 19:32:22 +02:00
|
|
|
</indexterm>
|
|
|
|
|
2004-08-12 21:12:21 +02:00
|
|
|
<indexterm zone="sql-release-savepoint">
|
2004-08-01 19:32:22 +02:00
|
|
|
<primary>savepoints</primary>
|
|
|
|
<secondary>releasing</secondary>
|
|
|
|
</indexterm>
|
|
|
|
|
|
|
|
<refsynopsisdiv>
|
|
|
|
<synopsis>
|
2004-08-12 21:12:21 +02:00
|
|
|
RELEASE [ SAVEPOINT ] <replaceable>savepoint_name</replaceable>
|
2004-08-01 19:32:22 +02:00
|
|
|
</synopsis>
|
|
|
|
</refsynopsisdiv>
|
|
|
|
|
|
|
|
<refsect1>
|
|
|
|
<title>Description</title>
|
|
|
|
|
|
|
|
<para>
|
2004-08-12 21:12:21 +02:00
|
|
|
<command>RELEASE SAVEPOINT</command> destroys a savepoint previously defined
|
2004-08-01 19:32:22 +02:00
|
|
|
in the current transaction.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
Destroying a savepoint makes it unavailable as a rollback point,
|
|
|
|
but it has no other user visible behavior. It does not undo the
|
|
|
|
effects of commands executed after the savepoint was established.
|
2010-04-03 09:23:02 +02:00
|
|
|
(To do that, see <xref linkend="sql-rollback-to">.)
|
|
|
|
Destroying a savepoint when
|
Update reference documentation on may/can/might:
Standard English uses "may", "can", and "might" in different ways:
may - permission, "You may borrow my rake."
can - ability, "I can lift that log."
might - possibility, "It might rain today."
Unfortunately, in conversational English, their use is often mixed, as
in, "You may use this variable to do X", when in fact, "can" is a better
choice. Similarly, "It may crash" is better stated, "It might crash".
2007-02-01 00:26:05 +01:00
|
|
|
it is no longer needed allows the system to reclaim some resources
|
2004-08-01 19:32:22 +02:00
|
|
|
earlier than transaction end.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
2004-08-12 21:12:21 +02:00
|
|
|
<command>RELEASE SAVEPOINT</command> also destroys all savepoints that were
|
2004-08-01 19:32:22 +02:00
|
|
|
established after the named savepoint was established.
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1>
|
|
|
|
<title>Parameters</title>
|
|
|
|
|
|
|
|
<variablelist>
|
|
|
|
<varlistentry>
|
|
|
|
<term><replaceable>savepoint_name</replaceable></term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
The name of the savepoint to destroy.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1>
|
|
|
|
<title>Notes</title>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
Specifying a savepoint name that was not previously defined is an error.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
It is not possible to release a savepoint when the transaction is in
|
2004-08-24 02:06:51 +02:00
|
|
|
an aborted state.
|
2004-08-01 19:32:22 +02:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
If multiple savepoints have the same name, only the one that was most
|
|
|
|
recently defined is released.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1>
|
|
|
|
<title>Examples</title>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
To establish and later destroy a savepoint:
|
|
|
|
<programlisting>
|
|
|
|
BEGIN;
|
2005-01-06 21:53:34 +01:00
|
|
|
INSERT INTO table1 VALUES (3);
|
2004-08-01 19:32:22 +02:00
|
|
|
SAVEPOINT my_savepoint;
|
2005-01-06 21:53:34 +01:00
|
|
|
INSERT INTO table1 VALUES (4);
|
2004-08-12 21:12:21 +02:00
|
|
|
RELEASE SAVEPOINT my_savepoint;
|
2004-08-01 19:32:22 +02:00
|
|
|
COMMIT;
|
|
|
|
</programlisting>
|
|
|
|
The above transaction will insert both 3 and 4.
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1>
|
|
|
|
<title>Compatibility</title>
|
|
|
|
|
|
|
|
<para>
|
2005-11-01 22:09:51 +01:00
|
|
|
This command conforms to the <acronym>SQL</> standard. The standard
|
2004-11-27 22:27:08 +01:00
|
|
|
specifies that the key word <literal>SAVEPOINT</literal> is
|
|
|
|
mandatory, but <productname>PostgreSQL</productname> allows it to
|
|
|
|
be omitted.
|
2004-08-01 19:32:22 +02:00
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1>
|
|
|
|
<title>See Also</title>
|
|
|
|
|
|
|
|
<simplelist type="inline">
|
2010-04-03 09:23:02 +02:00
|
|
|
<member><xref linkend="sql-begin"></member>
|
|
|
|
<member><xref linkend="sql-commit"></member>
|
|
|
|
<member><xref linkend="sql-rollback"></member>
|
|
|
|
<member><xref linkend="sql-rollback-to"></member>
|
|
|
|
<member><xref linkend="sql-savepoint"></member>
|
2004-08-01 19:32:22 +02:00
|
|
|
</simplelist>
|
|
|
|
</refsect1>
|
|
|
|
</refentry>
|