Home Explore Blog CI



postgresql

3rd chunk of `doc/src/sgml/ref/alter_subscription.sgml`
f854699dda1f8f5747f0a9468c39d08a4365f25d63dffbf50000000100000fa4
 <replaceable class="parameter">publication_name</replaceable></literal></term>
    <term><literal>ADD PUBLICATION <replaceable class="parameter">publication_name</replaceable></literal></term>
    <term><literal>DROP PUBLICATION <replaceable class="parameter">publication_name</replaceable></literal></term>
    <listitem>
     <para>
      These forms change the list of subscribed publications.
      <literal>SET</literal>
      replaces the entire list of publications with a new list,
      <literal>ADD</literal> adds additional publications to the list of
      publications, and <literal>DROP</literal> removes the publications from
      the list of publications.  We allow non-existent publications to be
      specified in <literal>ADD</literal> and <literal>SET</literal> variants
      so that users can add those later.  See <xref linkend="sql-createsubscription"/>
      for more information.  By default, this command will also act like
      <literal>REFRESH PUBLICATION</literal>.
     </para>

     <para>
      <replaceable>publication_option</replaceable> specifies additional
      options for this operation.  The supported options are:

      <variablelist>
       <varlistentry>
        <term><literal>refresh</literal> (<type>boolean</type>)</term>
        <listitem>
         <para>
          When false, the command will not try to refresh table information.
          <literal>REFRESH PUBLICATION</literal> should then be executed separately.
          The default is <literal>true</literal>.
         </para>
        </listitem>
       </varlistentry>
      </variablelist>

      Additionally, the options described under
      <literal>REFRESH PUBLICATION</literal> may be specified, to control the
      implicit refresh operation.
     </para>
    </listitem>
   </varlistentry>

   <varlistentry id="sql-altersubscription-params-refresh-publication">
    <term><literal>REFRESH PUBLICATION</literal></term>
    <listitem>
     <para>
      Fetch missing table information from publisher.  This will start
      replication of tables that were added to the subscribed-to publications
      since <link linkend="sql-createsubscription">
      <command>CREATE SUBSCRIPTION</command></link> or
      the last invocation of <command>REFRESH PUBLICATION</command>.
     </para>

     <para>
      <replaceable>refresh_option</replaceable> specifies additional options for the
      refresh operation.  The supported options are:

      <variablelist>
       <varlistentry>
        <term><literal>copy_data</literal> (<type>boolean</type>)</term>
        <listitem>
         <para>
          Specifies whether to copy pre-existing data in the publications
          that are being subscribed to when the replication starts.
          The default is <literal>true</literal>.
         </para>
         <para>
          Previously subscribed tables are not copied, even if a table's row
          filter <literal>WHERE</literal> clause has since been modified.
         </para>
         <para>
          See <xref linkend="sql-createsubscription-notes"/> for details of
          how <literal>copy_data = true</literal> can interact with the
          <link linkend="sql-createsubscription-params-with-origin"><literal>origin</literal></link>
          parameter.
         </para>
         <para>
          See the
          <link linkend="sql-createsubscription-params-with-binary"><literal>binary</literal></link>
          parameter of <command>CREATE SUBSCRIPTION</command> for details about
          copying pre-existing data in binary format.
         </para>
        </listitem>
       </varlistentry>
      </variablelist></para>
    </listitem>
   </varlistentry>

   <varlistentry id="sql-altersubscription-params-enable">
    <term><literal>ENABLE</literal></term>
    <listitem>
     <para>
      Enables a previously disabled subscription, starting the logical
      replication worker at the end of the transaction.
     </para>
    </listitem>
   </varlistentry>

Title: ALTER SUBSCRIPTION Parameters: Publication Management and Refreshing
Summary
This section details the parameters for ALTER SUBSCRIPTION, specifically focusing on managing publications and refreshing the subscription. It covers SET, ADD, and DROP PUBLICATION commands for modifying the list of subscribed publications, including the 'refresh' option to control automatic table information updates. Additionally, it describes the REFRESH PUBLICATION command, which fetches missing table information from the publisher, along with the 'copy_data' option to specify whether pre-existing data should be copied during replication startup. Finally, it explains the ENABLE parameter, which activates a previously disabled subscription.