Home Explore Blog CI



postgresql

2nd chunk of `doc/src/sgml/ref/create_subscription.sgml`
20fdcdf2205a0951ae6fb783e283fbba9c37bb09fe3c75e50000000100000fa5
 <term><literal>PUBLICATION <replaceable class="parameter">publication_name</replaceable> [, ...]</literal></term>
    <listitem>
     <para>
      Names of the publications on the publisher to subscribe to.
     </para>
    </listitem>
   </varlistentry>

   <varlistentry id="sql-createsubscription-params-with">
    <term><literal>WITH ( <replaceable class="parameter">subscription_parameter</replaceable> [= <replaceable class="parameter">value</replaceable>] [, ... ] )</literal></term>
    <listitem>
     <para>
      This clause specifies optional parameters for a subscription.
     </para>

     <para>
      The following parameters control what happens during subscription creation:

      <variablelist>

       <varlistentry id="sql-createsubscription-params-with-connect">
        <term><literal>connect</literal> (<type>boolean</type>)</term>
        <listitem>
         <para>
          Specifies whether the <command>CREATE SUBSCRIPTION</command>
          command should connect to the publisher at all.  The default
          is <literal>true</literal>.  Setting this to
          <literal>false</literal> will force the values of
          <literal>create_slot</literal>, <literal>enabled</literal> and
          <literal>copy_data</literal> to <literal>false</literal>.
          (You cannot combine setting <literal>connect</literal>
          to <literal>false</literal> with
          setting <literal>create_slot</literal>, <literal>enabled</literal>,
          or <literal>copy_data</literal> to <literal>true</literal>.)
         </para>

         <para>
          Since no connection is made when this option is
          <literal>false</literal>, no tables are subscribed. To initiate
          replication, you must manually create the replication slot, enable
          the failover if required, enable the subscription, and refresh the
          subscription. See
          <xref linkend="logical-replication-subscription-examples-deferred-slot"/>
          for examples.
         </para>
        </listitem>
       </varlistentry>

       <varlistentry id="sql-createsubscription-params-with-create-slot">
        <term><literal>create_slot</literal> (<type>boolean</type>)</term>
        <listitem>
         <para>
          Specifies whether the command should create the replication slot on
          the publisher.  The default is <literal>true</literal>.
         </para>
         <para>
          If set to <literal>false</literal>, you are responsible for
          creating the publisher's slot in some other way. See
          <xref linkend="logical-replication-subscription-examples-deferred-slot"/>
          for examples.
         </para>
        </listitem>
       </varlistentry>

       <varlistentry id="sql-createsubscription-params-with-enabled">
        <term><literal>enabled</literal> (<type>boolean</type>)</term>
        <listitem>
         <para>
          Specifies whether the subscription should be actively replicating
          or whether it should just be set up but not started yet.  The default
          is <literal>true</literal>.
         </para>
        </listitem>
       </varlistentry>

       <varlistentry id="sql-createsubscription-params-with-slot-name">
        <term><literal>slot_name</literal> (<type>string</type>)</term>
        <listitem>
         <para>
          Name of the publisher's replication slot to use.  The default is
          to use the name of the subscription for the slot name.
         </para>

         <para>
          Setting <literal>slot_name</literal> to <literal>NONE</literal>
          means there will be no replication slot associated with the
          subscription. Such subscriptions must also have both
          <literal>enabled</literal> and <literal>create_slot</literal> set to
          <literal>false</literal>.  Use this when you will be creating the
          replication slot later manually. See
          <xref linkend="logical-replication-subscription-examples-deferred-slot"/>

Title: CREATE SUBSCRIPTION Parameters - Publications and WITH Clause
Summary
This section details the `PUBLICATION` and `WITH` clause parameters for the `CREATE SUBSCRIPTION` command. The `PUBLICATION` parameter specifies the names of publications on the publisher to subscribe to. The `WITH` clause provides optional parameters, including `connect` (whether to connect to the publisher), `create_slot` (whether to create a replication slot on the publisher), `enabled` (whether the subscription should actively replicate), and `slot_name` (the name of the replication slot to use).