gooderp18绿色标准版
No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

45 líneas
5.6KB

  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>DROP SUBSCRIPTION</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-dropstatistics.html" title="DROP STATISTICS" /><link rel="next" href="sql-droptable.html" title="DROP TABLE" /></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">DROP SUBSCRIPTION</th></tr><tr><td width="10%" align="left"><a accesskey="p" href="sql-dropstatistics.html" title="DROP STATISTICS">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-droptable.html" title="DROP TABLE">Next</a></td></tr></table><hr></hr></div><div class="refentry" id="SQL-DROPSUBSCRIPTION"><div class="titlepage"></div><a id="id-1.9.3.133.1" class="indexterm"></a><div class="refnamediv"><h2><span class="refentrytitle">DROP SUBSCRIPTION</span></h2><p>DROP SUBSCRIPTION — remove a subscription</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis">
  3. DROP SUBSCRIPTION [ IF EXISTS ] <em class="replaceable"><code>name</code></em> [ CASCADE | RESTRICT ]
  4. </pre></div><div class="refsect1" id="id-1.9.3.133.5"><h2>Description</h2><p>
  5. <code class="command">DROP SUBSCRIPTION</code> removes a subscription from the
  6. database cluster.
  7. </p><p>
  8. A subscription can only be dropped by a superuser.
  9. </p><p>
  10. <code class="command">DROP SUBSCRIPTION</code> cannot be executed inside a
  11. transaction block if the subscription is associated with a replication
  12. slot. (You can use <code class="command">ALTER SUBSCRIPTION</code> to unset the
  13. slot.)
  14. </p></div><div class="refsect1" id="id-1.9.3.133.6"><h2>Parameters</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="replaceable"><code>name</code></em></span></dt><dd><p>
  15. The name of a subscription to be dropped.
  16. </p></dd><dt><span class="term"><code class="literal">CASCADE</code><br /></span><span class="term"><code class="literal">RESTRICT</code></span></dt><dd><p>
  17. These key words do not have any effect, since there are no dependencies
  18. on subscriptions.
  19. </p></dd></dl></div></div><div class="refsect1" id="id-1.9.3.133.7"><h2>Notes</h2><p>
  20. When dropping a subscription that is associated with a replication slot on
  21. the remote host (the normal state), <code class="command">DROP SUBSCRIPTION</code>
  22. will connect to the remote host and try to drop the replication slot as
  23. part of its operation. This is necessary so that the resources allocated
  24. for the subscription on the remote host are released. If this fails,
  25. either because the remote host is not reachable or because the remote
  26. replication slot cannot be dropped or does not exist or never existed,
  27. the <code class="command">DROP SUBSCRIPTION</code> command will fail. To proceed in
  28. this situation, disassociate the subscription from the replication slot by
  29. executing <code class="literal">ALTER SUBSCRIPTION ... SET (slot_name = NONE)</code>.
  30. After that, <code class="command">DROP SUBSCRIPTION</code> will no longer attempt any
  31. actions on a remote host. Note that if the remote replication slot still
  32. exists, it should then be dropped manually; otherwise it will continue to
  33. reserve WAL and might eventually cause the disk to fill up. See
  34. also <a class="xref" href="logical-replication-subscription.html#LOGICAL-REPLICATION-SUBSCRIPTION-SLOT" title="30.2.1. Replication Slot Management">Section 30.2.1</a>.
  35. </p><p>
  36. If a subscription is associated with a replication slot, then <code class="command">DROP
  37. SUBSCRIPTION</code> cannot be executed inside a transaction block.
  38. </p></div><div class="refsect1" id="id-1.9.3.133.8"><h2>Examples</h2><p>
  39. Drop a subscription:
  40. </p><pre class="programlisting">
  41. DROP SUBSCRIPTION mysub;
  42. </pre></div><div class="refsect1" id="id-1.9.3.133.9"><h2>Compatibility</h2><p>
  43. <code class="command">DROP SUBSCRIPTION</code> is a <span class="productname">PostgreSQL</span>
  44. extension.
  45. </p></div><div class="refsect1" id="id-1.9.3.133.10"><h2>See Also</h2><span class="simplelist"><a class="xref" href="sql-createsubscription.html" title="CREATE SUBSCRIPTION"><span class="refentrytitle">CREATE SUBSCRIPTION</span></a>, <a class="xref" href="sql-altersubscription.html" title="ALTER SUBSCRIPTION"><span class="refentrytitle">ALTER SUBSCRIPTION</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-dropstatistics.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-droptable.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">DROP STATISTICS </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> DROP TABLE</td></tr></table></div></body></html>
上海开阖软件有限公司 沪ICP备12045867号-1