|
| 1 | +<!-- |
| 2 | +$PostgreSQL: pgsql/doc/src/sgml/ref/release.sgml,v 1.1 2004/08/01 17:32:13 tgl Exp $ |
| 3 | +PostgreSQL documentation |
| 4 | +--> |
| 5 | + |
| 6 | +<refentry id="SQL-RELEASE"> |
| 7 | + <refmeta> |
| 8 | + <refentrytitle id="SQL-RELEASE-TITLE">RELEASE</refentrytitle> |
| 9 | + <refmiscinfo>SQL - Language Statements</refmiscinfo> |
| 10 | + </refmeta> |
| 11 | + |
| 12 | + <refnamediv> |
| 13 | + <refname>RELEASE</refname> |
| 14 | + <refpurpose>destroy a previously defined savepoint</refpurpose> |
| 15 | + </refnamediv> |
| 16 | + |
| 17 | + <indexterm zone="sql-release"> |
| 18 | + <primary>RELEASE</primary> |
| 19 | + </indexterm> |
| 20 | + |
| 21 | + <indexterm zone="sql-release"> |
| 22 | + <primary>savepoints</primary> |
| 23 | + <secondary>releasing</secondary> |
| 24 | + </indexterm> |
| 25 | + |
| 26 | + <refsynopsisdiv> |
| 27 | +<synopsis> |
| 28 | +RELEASE <replaceable>savepoint_name</replaceable> |
| 29 | +</synopsis> |
| 30 | + </refsynopsisdiv> |
| 31 | + |
| 32 | + <refsect1> |
| 33 | + <title>Description</title> |
| 34 | + |
| 35 | + <para> |
| 36 | + <command>RELEASE</command> destroys a savepoint previously defined |
| 37 | + in the current transaction. |
| 38 | + </para> |
| 39 | + |
| 40 | + <para> |
| 41 | + Destroying a savepoint makes it unavailable as a rollback point, |
| 42 | + but it has no other user visible behavior. It does not undo the |
| 43 | + effects of commands executed after the savepoint was established. |
| 44 | + (To do that, see <xref linkend="sql-rollback-to" |
| 45 | + endterm="sql-rollback-to-title">.) Destroying a savepoint when |
| 46 | + it is no longer needed may allow the system to reclaim some resources |
| 47 | + earlier than transaction end. |
| 48 | + </para> |
| 49 | + |
| 50 | + <para> |
| 51 | + <command>RELEASE</command> also destroys all savepoints that were |
| 52 | + established after the named savepoint was established. |
| 53 | + </para> |
| 54 | + </refsect1> |
| 55 | + |
| 56 | + <refsect1> |
| 57 | + <title>Parameters</title> |
| 58 | + |
| 59 | + <variablelist> |
| 60 | + <varlistentry> |
| 61 | + <term><replaceable>savepoint_name</replaceable></term> |
| 62 | + <listitem> |
| 63 | + <para> |
| 64 | + The name of the savepoint to destroy. |
| 65 | + </para> |
| 66 | + </listitem> |
| 67 | + </varlistentry> |
| 68 | + </variablelist> |
| 69 | + </refsect1> |
| 70 | + |
| 71 | + <refsect1> |
| 72 | + <title>Notes</title> |
| 73 | + |
| 74 | + <para> |
| 75 | + Specifying a savepoint name that was not previously defined is an error. |
| 76 | + </para> |
| 77 | + |
| 78 | + <para> |
| 79 | + It is not possible to release a savepoint when the transaction is in |
| 80 | + aborted state. |
| 81 | + </para> |
| 82 | + |
| 83 | + <para> |
| 84 | + If multiple savepoints have the same name, only the one that was most |
| 85 | + recently defined is released. |
| 86 | + </para> |
| 87 | + |
| 88 | + </refsect1> |
| 89 | + |
| 90 | + <refsect1> |
| 91 | + <title>Examples</title> |
| 92 | + |
| 93 | + <para> |
| 94 | + To establish and later destroy a savepoint: |
| 95 | +<programlisting> |
| 96 | +BEGIN; |
| 97 | + INSERT INTO table VALUES (3); |
| 98 | + SAVEPOINT my_savepoint; |
| 99 | + INSERT INTO table VALUES (4); |
| 100 | + RELEASE my_savepoint; |
| 101 | +COMMIT; |
| 102 | +</programlisting> |
| 103 | + The above transaction will insert both 3 and 4. |
| 104 | + </para> |
| 105 | + </refsect1> |
| 106 | + |
| 107 | + <refsect1> |
| 108 | + <title>Compatibility</title> |
| 109 | + |
| 110 | + <para> |
| 111 | + RELEASE is fully conforming to the SQL standard. |
| 112 | + </para> |
| 113 | + </refsect1> |
| 114 | + |
| 115 | + <refsect1> |
| 116 | + <title>See Also</title> |
| 117 | + |
| 118 | + <simplelist type="inline"> |
| 119 | + <member><xref linkend="sql-begin" endterm="sql-begin-title"></member> |
| 120 | + <member><xref linkend="sql-commit" endterm="sql-commit-title"></member> |
| 121 | + <member><xref linkend="sql-rollback" endterm="sql-rollback-title"></member> |
| 122 | + <member><xref linkend="sql-rollback-to" endterm="sql-rollback-to-title"></member> |
| 123 | + <member><xref linkend="sql-savepoint" endterm="sql-savepoint-title"></member> |
| 124 | + </simplelist> |
| 125 | + </refsect1> |
| 126 | +</refentry> |
| 127 | + |
| 128 | +<!-- Keep this comment at the end of the file |
| 129 | +Local variables: |
| 130 | +mode: sgml |
| 131 | +sgml-omittag:nil |
| 132 | +sgml-shorttag:t |
| 133 | +sgml-minimize-attributes:nil |
| 134 | +sgml-always-quote-attributes:t |
| 135 | +sgml-indent-step:1 |
| 136 | +sgml-indent-data:t |
| 137 | +sgml-parent-document:nil |
| 138 | +sgml-default-dtd-file:"../reference.ced" |
| 139 | +sgml-exposed-tags:nil |
| 140 | +sgml-local-catalogs:"/usr/lib/sgml/catalog" |
| 141 | +sgml-local-ecat-files:nil |
| 142 | +End: |
| 143 | +--> |
0 commit comments