Home Explore Blog CI



postgresql

80th chunk of `doc/src/sgml/protocol.sgml`
7c17e46889870972e0a35dd269f0b81d046f8a42c02e72ae0000000100000fa0
 </para>
       </listitem>
      </varlistentry>

      <varlistentry>
       <term>Byte1('O')</term>
       <listitem>
        <para>
         Identifies the following TupleData message as an old tuple.
         This field is present if the table in which the delete
         happened has REPLICA IDENTITY set to FULL.
        </para>
       </listitem>
      </varlistentry>

      <varlistentry>
       <term>TupleData</term>
       <listitem>
        <para>
         TupleData message part representing the contents of the old tuple
         or primary key, depending on the previous field.
        </para>
       </listitem>
      </varlistentry>
     </variablelist>

     <para>
      The Delete message may contain either a 'K' message part or an 'O' message part,
      but never both of them.
     </para>
    </listitem>
   </varlistentry>

   <varlistentry id="protocol-logicalrep-message-formats-Truncate">
    <term>Truncate</term>
    <listitem>
     <variablelist>
      <varlistentry>
       <term>Byte1('T')</term>
       <listitem>
        <para>
         Identifies the message as a truncate message.
        </para>
       </listitem>
      </varlistentry>

      <varlistentry>
       <term>Int32 (TransactionId)</term>
       <listitem>
        <para>
         Xid of the transaction (only present for streamed transactions).
         This field is available since protocol version 2.
        </para>
       </listitem>
      </varlistentry>

      <varlistentry>
       <term>Int32</term>
       <listitem>
        <para>
         Number of relations
        </para>
       </listitem>
      </varlistentry>

      <varlistentry>
       <term>Int8</term>
       <listitem>
        <para>
         Option bits for <command>TRUNCATE</command>:
         1 for <literal>CASCADE</literal>, 2 for <literal>RESTART IDENTITY</literal>
        </para>
       </listitem>
      </varlistentry>

      <varlistentry>
       <term>Int32 (Oid)</term>
       <listitem>
        <para>
         OID of the relation corresponding to the ID in the relation
         message.  This field is repeated for each relation.
        </para>
       </listitem>
      </varlistentry>
     </variablelist>
    </listitem>
   </varlistentry>
  </variablelist>

  <para>
   The following messages (Stream Start, Stream Stop, Stream Commit, and
   Stream Abort) are available since protocol version 2.
  </para>

  <variablelist>
   <varlistentry id="protocol-logicalrep-message-formats-Stream-Start">
    <term>Stream Start</term>
    <listitem>
     <variablelist>
      <varlistentry>
       <term>Byte1('S')</term>
       <listitem>
        <para>
         Identifies the message as a stream start message.
        </para>
       </listitem>
      </varlistentry>

      <varlistentry>
       <term>Int32 (TransactionId)</term>
       <listitem>
        <para>
         Xid of the transaction.
        </para>
       </listitem>
      </varlistentry>

      <varlistentry>
       <term>Int8</term>
       <listitem>
        <para>
         A value of 1 indicates this is the first stream segment for
         this XID, 0 for any other stream segment.
        </para>
       </listitem>
      </varlistentry>
     </variablelist>
    </listitem>
   </varlistentry>

   <varlistentry id="protocol-logicalrep-message-formats-Stream-Stop">
    <term>Stream Stop</term>
    <listitem>
     <variablelist>
      <varlistentry>
       <term>Byte1('E')</term>
       <listitem>
        <para>
         Identifies the message as a stream stop message.
        </para>
       </listitem>
      </varlistentry>
     </variablelist>
    </listitem>
   </varlistentry>

   <varlistentry id="protocol-logicalrep-message-formats-Stream-Commit">
    <term>Stream Commit</term>
    <listitem>
     <variablelist>
      <varlistentry>
       <term>Byte1('c')</term>
       <listitem>
        <para>
         Identifies the message as a stream commit message.
        </para>
       </listitem>
      </varlistentry>

  

Title: Logical Replication Message Formats for Truncate, Stream Start, Stream Stop, and Stream Commit
Summary
This section describes the message formats for Truncate, Stream Start, Stream Stop, and Stream Commit operations in logical replication, including identification of the message type, transaction ID, relation OID, option bits, and other relevant fields, with specific rules for the presence and repetition of certain fields, and notes on protocol version compatibility.