2004-08-01 19:32:22 +02:00
|
|
|
<!--
|
2004-08-12 21:12:21 +02:00
|
|
|
$PostgreSQL: pgsql/doc/src/sgml/ref/release_savepoint.sgml,v 1.1 2004/08/12 19:12:21 tgl 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>
|
2004-08-12 21:12:21 +02:00
|
|
|
<refentrytitle id="SQL-RELEASE-SAVEPOINT-TITLE">RELEASE SAVEPOINT</refentrytitle>
|
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.
|
|
|
|
(To do that, see <xref linkend="sql-rollback-to"
|
|
|
|
endterm="sql-rollback-to-title">.) Destroying a savepoint when
|
|
|
|
it is no longer needed may allow the system to reclaim some resources
|
|
|
|
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
|
|
|
|
aborted state.
|
|
|
|
</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;
|
|
|
|
INSERT INTO table VALUES (3);
|
|
|
|
SAVEPOINT my_savepoint;
|
|
|
|
INSERT INTO table 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>
|
2004-08-12 21:12:21 +02:00
|
|
|
The SQL2003 standard specifies that the keyword SAVEPOINT is mandatory.
|
|
|
|
<productname>PostgreSQL</productname> allows the SAVEPOINT keyword to be
|
|
|
|
omitted. Otherwise, this command is fully conforming.
|
2004-08-01 19:32:22 +02:00
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1>
|
|
|
|
<title>See Also</title>
|
|
|
|
|
|
|
|
<simplelist type="inline">
|
|
|
|
<member><xref linkend="sql-begin" endterm="sql-begin-title"></member>
|
|
|
|
<member><xref linkend="sql-commit" endterm="sql-commit-title"></member>
|
|
|
|
<member><xref linkend="sql-rollback" endterm="sql-rollback-title"></member>
|
|
|
|
<member><xref linkend="sql-rollback-to" endterm="sql-rollback-to-title"></member>
|
|
|
|
<member><xref linkend="sql-savepoint" endterm="sql-savepoint-title"></member>
|
|
|
|
</simplelist>
|
|
|
|
</refsect1>
|
|
|
|
</refentry>
|
|
|
|
|
|
|
|
<!-- Keep this comment at the end of the file
|
|
|
|
Local variables:
|
|
|
|
mode: sgml
|
|
|
|
sgml-omittag:nil
|
|
|
|
sgml-shorttag:t
|
|
|
|
sgml-minimize-attributes:nil
|
|
|
|
sgml-always-quote-attributes:t
|
|
|
|
sgml-indent-step:1
|
|
|
|
sgml-indent-data:t
|
|
|
|
sgml-parent-document:nil
|
|
|
|
sgml-default-dtd-file:"../reference.ced"
|
|
|
|
sgml-exposed-tags:nil
|
|
|
|
sgml-local-catalogs:"/usr/lib/sgml/catalog"
|
|
|
|
sgml-local-ecat-files:nil
|
|
|
|
End:
|
|
|
|
-->
|