Home Explore Blog CI



postgresql

2nd chunk of `doc/src/sgml/ref/pg_createsubscriber.sgml`
c6161c5c6866340dca2713714120523268a0740dfc95fd270000000100000faf
 <refsect1>
  <title>Options</title>

  <para>
   <application>pg_createsubscriber</application> accepts the following
   command-line arguments:

   <variablelist>
    <varlistentry>
     <term><option>-a</option></term>
     <term><option>--all</option></term>
     <listitem>
      <para>
       Create one subscription per database on the target server. Exceptions
       are template databases and databases that don't allow connections.
       To discover the list of all databases, connect to the source server
       using the database name specified in the <option>--publisher-server</option>
       connection string, or if not specified, the <literal>postgres</literal>
       database will be used, or if that does not exist, <literal>template1</literal>
       will be used.
       Automatically generated names for subscriptions, publications, and
       replication slots are used when this option is specified.
       This option cannot be used along with <option>--database</option>,
       <option>--publication</option>, <option>--replication-slot</option>, or
       <option>--subscription</option>.
      </para>
     </listitem>
    </varlistentry>

    <varlistentry>
     <term><option>-d <replaceable class="parameter">dbname</replaceable></option></term>
     <term><option>--database=<replaceable class="parameter">dbname</replaceable></option></term>
     <listitem>
      <para>
       The name of the database in which to create a subscription.  Multiple
       databases can be selected by writing multiple <option>-d</option>
       switches. This option cannot be used together with <option>-a</option>.
       If <option>-d</option> option is not provided, the database name will be
       obtained from <option>-P</option> option. If the database name is not
       specified in either the <option>-d</option> option, or the
       <option>-P</option> option, and <option>-a</option> option is not
       specified, an error will be reported.
      </para>
     </listitem>
    </varlistentry>

    <varlistentry>
     <term><option>-D <replaceable class="parameter">directory</replaceable></option></term>
     <term><option>--pgdata=<replaceable class="parameter">directory</replaceable></option></term>
     <listitem>
      <para>
       The target directory that contains a cluster directory from a physical
       replica.
      </para>
     </listitem>
    </varlistentry>

    <varlistentry>
     <term><option>-n</option></term>
     <term><option>--dry-run</option></term>
     <listitem>
      <para>
       Do everything except actually modifying the target directory.
      </para>
     </listitem>
    </varlistentry>

    <varlistentry>
     <term><option>-p <replaceable class="parameter">port</replaceable></option></term>
     <term><option>--subscriber-port=<replaceable class="parameter">port</replaceable></option></term>
     <listitem>
      <para>
       The port number on which the target server is listening for
       connections.  Defaults to running the target server on port 50432 to
       avoid unintended client connections.
      </para>
     </listitem>
    </varlistentry>

    <varlistentry>
     <term><option>-P <replaceable class="parameter">connstr</replaceable></option></term>
     <term><option>--publisher-server=<replaceable class="parameter">connstr</replaceable></option></term>
     <listitem>
      <para>
       The connection string to the publisher.  For details see <xref
       linkend="libpq-connstring"/>.
      </para>
     </listitem>
    </varlistentry>

    <varlistentry>
     <term><option>-R <replaceable class="parameter">objtype</replaceable></option></term>
     <term><option>--remove=<replaceable class="parameter">objtype</replaceable></option></term>
     <listitem>
      <para>
       Remove all objects of the specified type from specified databases on the
       target server.
      </para>
      <para>
       <itemizedlist>
        <listitem>
         <para>
          <literal>publications</literal>:

Title: pg_createsubscriber Options
Summary
This section details the command-line options for pg_createsubscriber. Options include: -a/--all to create subscriptions for all databases (excluding template and non-connectable databases), -d/--database to specify a database to create a subscription in, -D/--pgdata to specify the target directory of the physical replica, -n/--dry-run to perform a dry run, -p/--subscriber-port to set the target server's port, -P/--publisher-server to provide the publisher's connection string, and -R/--remove to remove specific object types.