Home Explore Blog CI



postgresql

34th chunk of `doc/src/sgml/protocol.sgml`
b4a59ad56507bd17ae77a19f0c5a3b65db6ff588fc3ff0870000000100000fa4
 </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> <replaceable class="parameter">slot_name</replaceable> ( <replaceable class="parameter">option</replaceable> [, ...] )
      <indexterm><primary>ALTER_REPLICATION_SLOT</primary></indexterm>
     </term>
     <listitem>
      <para>
       Change the definition of a replication slot.
       See <xref linkend="streaming-replication-slots"/> for more about
       replication slots. This command is currently only supported for logical
       replication slots.
      </para>

      <variablelist>
       <varlistentry>
        <term><replaceable class="parameter">slot_name</replaceable></term>
        <listitem>
         <para>
          The name of the slot to alter. Must be a valid replication slot
          name (see <xref linkend="streaming-replication-slots-manipulation"/>).
         </para>
        </listitem>
       </varlistentry>
      </variablelist>

      <para>The following options are supported:</para>

      <variablelist>
       <varlistentry>
        <term><literal>TWO_PHASE [ <replaceable class="parameter">boolean</replaceable> ]</literal></term>
        <listitem>
         <para>
          If true, this logical replication slot supports decoding of two-phase
          commit. With this option, commands related to two-phase commit such as
          <literal>PREPARE TRANSACTION</literal>, <literal>COMMIT PREPARED</literal>
          and <literal>ROLLBACK PREPARED</literal> are decoded and transmitted.
          The transaction will be decoded and transmitted at
          <literal>PREPARE TRANSACTION</literal> time.
         </para>
        </listitem>
       </varlistentry>
      </variablelist>

      <variablelist>
       <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.
         </para>
        </listitem>
       </varlistentry>
      </variablelist>

     </listitem>
    </varlistentry>

    <varlistentry id="protocol-replication-read-replication-slot">
     <term><literal>READ_REPLICATION_SLOT</literal> <replaceable class="parameter">slot_name</replaceable>
      <indexterm><primary>READ_REPLICATION_SLOT</primary></indexterm>
     </term>
     <listitem>
      <para>
       Read some information associated with a replication slot. Returns a tuple
       with <literal>NULL</literal> values if the replication slot does not
       exist. This command is currently only supported for physical replication
       slots.
      </para>

      <para>
       In response to this command, the server will return a one-row result set,
       containing the following fields:
       <variablelist>
        <varlistentry>
         <term><literal>slot_type</literal> (<type>text</type>)</term>
         <listitem>
          <para>
           The replication slot's type, either <literal>physical</literal>

Title: Replication Slot Management Commands
Summary
The document describes various commands for managing replication slots, including ALTER_REPLICATION_SLOT for changing slot definitions, READ_REPLICATION_SLOT for reading slot information, and options for controlling two-phase commit, failover, and slot types, with details on supported options and return values.