gooderp18绿色标准版
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
5.1KB

  1. <?xml version="1.0" encoding="UTF-8" standalone="no"?>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>RELEASE SAVEPOINT</title><link rel="stylesheet" type="text/css" href="stylesheet.css" /><link rev="made" href="pgsql-docs@lists.postgresql.org" /><meta name="generator" content="DocBook XSL Stylesheets V1.79.1" /><link rel="prev" href="sql-reindex.html" title="REINDEX" /><link rel="next" href="sql-reset.html" title="RESET" /></head><body><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="5" align="center">RELEASE SAVEPOINT</th></tr><tr><td width="10%" align="left"><a accesskey="p" href="sql-reindex.html" title="REINDEX">Prev</a> </td><td width="10%" align="left"><a accesskey="u" href="sql-commands.html" title="SQL Commands">Up</a></td><th width="60%" align="center">SQL Commands</th><td width="10%" align="right"><a accesskey="h" href="index.html" title="PostgreSQL 12.4 Documentation">Home</a></td><td width="10%" align="right"> <a accesskey="n" href="sql-reset.html" title="RESET">Next</a></td></tr></table><hr></hr></div><div class="refentry" id="SQL-RELEASE-SAVEPOINT"><div class="titlepage"></div><a id="id-1.9.3.163.1" class="indexterm"></a><a id="id-1.9.3.163.2" class="indexterm"></a><div class="refnamediv"><h2><span class="refentrytitle">RELEASE SAVEPOINT</span></h2><p>RELEASE SAVEPOINT — destroy a previously defined savepoint</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis">
  3. RELEASE [ SAVEPOINT ] <em class="replaceable"><code>savepoint_name</code></em>
  4. </pre></div><div class="refsect1" id="id-1.9.3.163.6"><h2>Description</h2><p>
  5. <code class="command">RELEASE SAVEPOINT</code> destroys a savepoint previously defined
  6. in the current transaction.
  7. </p><p>
  8. Destroying a savepoint makes it unavailable as a rollback point,
  9. but it has no other user visible behavior. It does not undo the
  10. effects of commands executed after the savepoint was established.
  11. (To do that, see <a class="xref" href="sql-rollback-to.html" title="ROLLBACK TO SAVEPOINT"><span class="refentrytitle">ROLLBACK TO SAVEPOINT</span></a>.)
  12. Destroying a savepoint when
  13. it is no longer needed allows the system to reclaim some resources
  14. earlier than transaction end.
  15. </p><p>
  16. <code class="command">RELEASE SAVEPOINT</code> also destroys all savepoints that were
  17. established after the named savepoint was established.
  18. </p></div><div class="refsect1" id="id-1.9.3.163.7"><h2>Parameters</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="replaceable"><code>savepoint_name</code></em></span></dt><dd><p>
  19. The name of the savepoint to destroy.
  20. </p></dd></dl></div></div><div class="refsect1" id="id-1.9.3.163.8"><h2>Notes</h2><p>
  21. Specifying a savepoint name that was not previously defined is an error.
  22. </p><p>
  23. It is not possible to release a savepoint when the transaction is in
  24. an aborted state.
  25. </p><p>
  26. If multiple savepoints have the same name, only the one that was most
  27. recently defined is released.
  28. </p></div><div class="refsect1" id="id-1.9.3.163.9"><h2>Examples</h2><p>
  29. To establish and later destroy a savepoint:
  30. </p><pre class="programlisting">
  31. BEGIN;
  32. INSERT INTO table1 VALUES (3);
  33. SAVEPOINT my_savepoint;
  34. INSERT INTO table1 VALUES (4);
  35. RELEASE SAVEPOINT my_savepoint;
  36. COMMIT;
  37. </pre><p>
  38. The above transaction will insert both 3 and 4.
  39. </p></div><div class="refsect1" id="id-1.9.3.163.10"><h2>Compatibility</h2><p>
  40. This command conforms to the <acronym class="acronym">SQL</acronym> standard. The standard
  41. specifies that the key word <code class="literal">SAVEPOINT</code> is
  42. mandatory, but <span class="productname">PostgreSQL</span> allows it to
  43. be omitted.
  44. </p></div><div class="refsect1" id="id-1.9.3.163.11"><h2>See Also</h2><span class="simplelist"><a class="xref" href="sql-begin.html" title="BEGIN"><span class="refentrytitle">BEGIN</span></a>, <a class="xref" href="sql-commit.html" title="COMMIT"><span class="refentrytitle">COMMIT</span></a>, <a class="xref" href="sql-rollback.html" title="ROLLBACK"><span class="refentrytitle">ROLLBACK</span></a>, <a class="xref" href="sql-rollback-to.html" title="ROLLBACK TO SAVEPOINT"><span class="refentrytitle">ROLLBACK TO SAVEPOINT</span></a>, <a class="xref" href="sql-savepoint.html" title="SAVEPOINT"><span class="refentrytitle">SAVEPOINT</span></a></span></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="sql-reindex.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="sql-commands.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="sql-reset.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">REINDEX </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> RESET</td></tr></table></div></body></html>
上海开阖软件有限公司 沪ICP备12045867号-1