Home Explore Blog CI



postgresql

1st chunk of `doc/src/sgml/ref/drop_subscription.sgml`
3fd7c4f01df50110e6221a5d451a0d44b0e5a7cbb5c8619b00000001000007e4
<!--
doc/src/sgml/ref/drop_subscription.sgml
PostgreSQL documentation
-->

<refentry id="sql-dropsubscription">
 <indexterm zone="sql-dropsubscription">
  <primary>DROP SUBSCRIPTION</primary>
 </indexterm>

 <refmeta>
  <refentrytitle>DROP SUBSCRIPTION</refentrytitle>
  <manvolnum>7</manvolnum>
  <refmiscinfo>SQL - Language Statements</refmiscinfo>
 </refmeta>

 <refnamediv>
  <refname>DROP SUBSCRIPTION</refname>
  <refpurpose>remove a subscription</refpurpose>
 </refnamediv>

 <refsynopsisdiv>
<synopsis>
DROP SUBSCRIPTION [ IF EXISTS ] <replaceable class="parameter">name</replaceable> [ CASCADE | RESTRICT ]
</synopsis>
 </refsynopsisdiv>

 <refsect1>
  <title>Description</title>

  <para>
   <command>DROP SUBSCRIPTION</command> removes a subscription from the
   database cluster.
  </para>

  <para>
   To execute this command the user must be the owner of the subscription.
  </para>

  <para>
   <command>DROP SUBSCRIPTION</command> cannot be executed inside a
   transaction block if the subscription is associated with a replication
   slot.  (You can use <link linkend="sql-altersubscription"><command>ALTER SUBSCRIPTION</command></link> to unset the
   slot.)
  </para>
 </refsect1>

 <refsect1>
  <title>Parameters</title>

  <variablelist>
   <varlistentry>
    <term><replaceable class="parameter">name</replaceable></term>
    <listitem>
     <para>
      The name of a subscription to be dropped.
     </para>
    </listitem>
   </varlistentry>

   <varlistentry>
    <term><literal>CASCADE</literal></term>
    <term><literal>RESTRICT</literal></term>

    <listitem>
     <para>
      These key words do not have any effect, since there are no dependencies
      on subscriptions.
     </para>
    </listitem>
   </varlistentry>

  </variablelist>
 </refsect1>

 <refsect1>
  <title>Notes</title>

  <para>
   When dropping a subscription that is associated with a replication slot on
   the remote host (the normal state), <command>DROP SUBSCRIPTION</command>
   will connect to the remote host

Title: DROP SUBSCRIPTION
Summary
The DROP SUBSCRIPTION command removes a subscription from the database cluster. The user must be the owner of the subscription. It cannot be executed inside a transaction block if the subscription is associated with a replication slot. The CASCADE and RESTRICT options have no effect. When dropping a subscription associated with a replication slot on the remote host, DROP SUBSCRIPTION will connect to the remote host.