Home Explore Blog CI



postgresql

33th chunk of `doc/src/sgml/protocol.sgml`
1565246506dedb652892d82f7805cce62e8665cb30c87d410000000100000fcc
 upon
          connection from a streaming replication client.
          The default is false.
         </para>
        </listitem>
       </varlistentry>

       <varlistentry>
        <term><literal>SNAPSHOT { 'export' | 'use' | 'nothing' }</literal></term>
        <listitem>
         <para>
          Decides what to do with the snapshot created during logical slot
          initialization. <literal>'export'</literal>, which is the default,
          will export the snapshot for use in other sessions. This option can't
          be used inside a transaction.  <literal>'use'</literal> will use the
          snapshot for the current transaction executing the command. This
          option must be used in a transaction, and
          <literal>CREATE_REPLICATION_SLOT</literal> must be the first command
          run in that transaction.  Finally, <literal>'nothing'</literal> will
          just use the snapshot for logical decoding as normal but won't do
          anything else with it.
         </para>
        </listitem>
       </varlistentry>

       <varlistentry>
        <term><literal>FAILOVER [ <replaceable class="parameter">boolean</replaceable> ]</literal></term>
        <listitem>
         <para>
          If true, the slot is enabled to be synced to the standbys
          so that logical replication can be resumed after failover.
          The default is false.
         </para>
        </listitem>
       </varlistentry>
      </variablelist>

      <para>
       In response to this command, the server will send a one-row result set
       containing the following fields:

       <variablelist>
        <varlistentry>
         <term><literal>slot_name</literal> (<type>text</type>)</term>
         <listitem>
          <para>
           The name of the newly-created replication slot.
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><literal>consistent_point</literal> (<type>text</type>)</term>
         <listitem>
          <para>
           The WAL location at which the slot became consistent.  This is the
           earliest location from which streaming can start on this replication
           slot.
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><literal>snapshot_name</literal> (<type>text</type>)</term>
         <listitem>
          <para>
           The identifier of the snapshot exported by the command.  The
           snapshot is valid until a new command is executed on this connection
           or the replication connection is closed.  Null if the created slot
           is physical.
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><literal>output_plugin</literal> (<type>text</type>)</term>
         <listitem>
          <para>
           The name of the output plugin used by the newly-created replication
           slot.  Null if the created slot is physical.
          </para>
         </listitem>
        </varlistentry>
       </variablelist>
      </para>
     </listitem>
    </varlistentry>

    <varlistentry id="protocol-replication-create-replication-slot-legacy">
     <term><literal>CREATE_REPLICATION_SLOT</literal> <replaceable class="parameter">slot_name</replaceable> [ <literal>TEMPORARY</literal> ] { <literal>PHYSICAL</literal> [ <literal>RESERVE_WAL</literal> ] | <literal>LOGICAL</literal> <replaceable class="parameter">output_plugin</replaceable> [ <literal>EXPORT_SNAPSHOT</literal> | <literal>NOEXPORT_SNAPSHOT</literal> | <literal>USE_SNAPSHOT</literal> | <literal>TWO_PHASE</literal> ] }
     </term>
     <listitem>
      <para>
       For compatibility with older releases, this alternative syntax for
       the <literal>CREATE_REPLICATION_SLOT</literal> command is still supported.
      </para>
     </listitem>
    </varlistentry>

    <varlistentry id="protocol-replication-alter-replication-slot" xreflabel="ALTER_REPLICATION_SLOT">
     <term><literal>ALTER_REPLICATION_SLOT</literal>

Title: CREATE_REPLICATION_SLOT Command Details
Summary
The CREATE_REPLICATION_SLOT command creates a replication slot, with options to control snapshot handling, failover, and other behaviors, and returns information about the newly created slot, including its name, consistent point, snapshot name, and output plugin.