Home Explore Blog CI



postgresql

5th chunk of `doc/src/sgml/ref/pg_createsubscriber.sgml`
12a0257463e93501be6981ba4b6f65522a05eb4a22d8be570000000100000fa0
  <option>--all</option>.
      </para>
     </listitem>
    </varlistentry>

    <varlistentry>
     <term><option>--subscription=<replaceable class="parameter">name</replaceable></option></term>
     <listitem>
      <para>
       The subscription name to set up the logical replication.  Multiple
       subscriptions can be specified by writing multiple
       <option>--subscription</option> switches.  The number of subscription
       names must match the number of specified databases, otherwise an error
       is reported.  The order of the multiple subscription name switches must
       match the order of database switches.  If this option is not specified,
       a generated name is assigned to the subscription name. This option cannot
       be used together with <option>--all</option>.
      </para>
     </listitem>
    </varlistentry>

    <varlistentry>
     <term><option>-V</option></term>
     <term><option>--version</option></term>
     <listitem>
      <para>
       Print the <application>pg_createsubscriber</application> version and exit.
      </para>
     </listitem>
    </varlistentry>

    <varlistentry>
     <term><option>-?</option></term>
     <term><option>--help</option></term>
     <listitem>
      <para>
       Show help about <application>pg_createsubscriber</application> command
       line arguments, and exit.
      </para>
     </listitem>
    </varlistentry>
    </variablelist>
   </para>
 </refsect1>

 <refsect1>
  <title>Notes</title>

  <refsect2>
   <title>Prerequisites</title>

   <para>
    There are some prerequisites for
    <application>pg_createsubscriber</application> to convert the target server
    into a logical replica.  If these are not met, an error will be reported.
    The source and target servers must have the same major version as the
    <application>pg_createsubscriber</application>.  The given target data
    directory must have the same system identifier as the source data
    directory.  The given database user for the target data directory must have
    privileges for creating <link
    linkend="sql-createsubscription">subscriptions</link> and using <link
    linkend="pg-replication-origin-advance"><function>pg_replication_origin_advance()</function></link>.
   </para>

   <para>
    The target server must be used as a physical standby.  The target server
    must have <xref linkend="guc-max-active-replication-origins"/> and <xref
    linkend="guc-max-logical-replication-workers"/> configured to a value
    greater than or equal to the number of specified databases.  The target
    server must have <xref linkend="guc-max-worker-processes"/> configured to a
    value greater than the number of specified databases.  The target server
    must accept local connections. If you are planning to use the
    <option>--enable-two-phase</option> switch then you will also need to set
    the <xref linkend="guc-max-prepared-transactions"/> appropriately.
   </para>

   <para>
    The source server must accept connections from the target server.  The
    source server must not be in recovery. The source server must have <xref
    linkend="guc-wal-level"/> as <literal>logical</literal>.  The source server
    must have <xref linkend="guc-max-replication-slots"/> configured to a value
    greater than or equal to the number of specified databases plus existing
    replication slots.  The source server must have <xref
    linkend="guc-max-wal-senders"/> configured to a value greater than or equal
    to the number of specified databases and existing WAL sender processes.
   </para>
  </refsect2>

  <refsect2>
   <title>Warnings</title>

   <para>
    If <application>pg_createsubscriber</application> fails after the target
    server was promoted, then the data directory is likely not in a state that
    can be recovered.  In such case, creating a new standby server is
    recommended.
   </para>

   <para>
    <application>pg_createsubscriber</application> usually starts the target
  

Title: pg_createsubscriber Options and Notes
Summary
This section details the remaining command-line options for pg_createsubscriber: -V/--version to print the version and -?/--help to show help. It also includes notes about the prerequisites for using pg_createsubscriber, such as version compatibility, privilege requirements, server configurations for both target and source servers, and warnings about potential data loss in case of failures after promotion.