Home Explore Blog CI



postgresql

60th chunk of `doc/src/sgml/protocol.sgml`
7c14058301cc54e521d683ea6848b0eb2c3351ce9959a1600000000100000fa6
 used for each column.
         Each must presently be zero (text) or one (binary).
         All must be zero if the overall copy format is textual.
        </para>
       </listitem>
      </varlistentry>
     </variablelist>
    </listitem>
   </varlistentry>

   <varlistentry id="protocol-message-formats-CopyBothResponse">
    <term>CopyBothResponse (B)</term>
    <listitem>
     <variablelist>
      <varlistentry>
       <term>Byte1('W')</term>
       <listitem>
        <para>
         Identifies the message as a Start Copy Both response.
         This message is used only for Streaming Replication.
        </para>
       </listitem>
      </varlistentry>

      <varlistentry>
       <term>Int32</term>
       <listitem>
        <para>
         Length of message contents in bytes, including self.
        </para>
       </listitem>
      </varlistentry>

      <varlistentry>
       <term>Int8</term>
       <listitem>
        <para>
         0 indicates the overall <command>COPY</command> format
         is textual (rows separated by newlines, columns
         separated by separator characters, etc.). 1 indicates
         the overall copy format is binary (similar to DataRow
         format). See <xref linkend="sql-copy"/> for more information.
        </para>
       </listitem>
      </varlistentry>

      <varlistentry>
       <term>Int16</term>
       <listitem>
        <para>
         The number of columns in the data to be copied
         (denoted <replaceable>N</replaceable> below).
        </para>
       </listitem>
      </varlistentry>

      <varlistentry>
       <term>Int16[<replaceable>N</replaceable>]</term>
       <listitem>
        <para>
         The format codes to be used for each column.
         Each must presently be zero (text) or one (binary).
         All must be zero if the overall copy format is textual.
        </para>
       </listitem>
      </varlistentry>
     </variablelist>
    </listitem>
   </varlistentry>

   <varlistentry id="protocol-message-formats-DataRow">
    <term>DataRow (B)</term>
    <listitem>
     <variablelist>
      <varlistentry>
       <term>Byte1('D')</term>
       <listitem>
        <para>
         Identifies the message as a data row.
        </para>
       </listitem>
      </varlistentry>

      <varlistentry>
       <term>Int32</term>
       <listitem>
        <para>
         Length of message contents in bytes, including self.
        </para>
       </listitem>
      </varlistentry>

      <varlistentry>
       <term>Int16</term>
       <listitem>
        <para>
         The number of column values that follow (possibly zero).
        </para>
       </listitem>
      </varlistentry>
     </variablelist>

     <para>
      Next, the following pair of fields appear for each column:
     </para>

     <variablelist>
      <varlistentry>
       <term>Int32</term>
       <listitem>
        <para>
         The length of the column value, in bytes (this count
         does not include itself).  Can be zero.
         As a special case, -1 indicates a NULL column value.
         No value bytes follow in the NULL case.
        </para>
       </listitem>
      </varlistentry>

      <varlistentry>
       <term>Byte<replaceable>n</replaceable></term>
       <listitem>
        <para>
         The value of the column, in the format indicated by the
         associated format code.
         <replaceable>n</replaceable> is the above length.
        </para>
       </listitem>
      </varlistentry>
     </variablelist>
    </listitem>
   </varlistentry>

   <varlistentry id="protocol-message-formats-Describe">
    <term>Describe (F)</term>
    <listitem>
     <variablelist>
      <varlistentry>
       <term>Byte1('D')</term>
       <listitem>
        <para>
         Identifies the message as a Describe command.
        </para>
       </listitem>
      </varlistentry>

      <varlistentry>
       <term>Int32</term>
       <listitem>
        <para>
         Length of message contents in bytes,

Title: Protocol Message Formats for PostgreSQL Operations
Summary
This section describes the message formats for various PostgreSQL operations, including CopyBothResponse, DataRow, and Describe, detailing the structure and content of each message type, such as message identification, length, column information, and value formats, and explains the usage of these messages in PostgreSQL protocols, including Streaming Replication and data exchange.