Home Explore Blog CI



postgresql

59th chunk of `doc/src/sgml/protocol.sgml`
f9c5dd6611f992b3a8a53abe7e44d7dcdd45d6bc10bd48170000000100000fae
    <para>
         Identifies the message as a Start Copy In response.
         The frontend must now send copy-in data (if not
         prepared to do so, send a CopyFail message).
        </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-CopyOutResponse">
    <term>CopyOutResponse (B)</term>
    <listitem>
     <variablelist>
      <varlistentry>
       <term>Byte1('H')</term>
       <listitem>
        <para>
         Identifies the message as a Start Copy Out response.
         This message will be followed by copy-out data.
        </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-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>

Title: Protocol Message Formats for COPY Operations
Summary
This section describes the message formats for COPY operations, including CopyInResponse, CopyOutResponse, and CopyBothResponse, detailing the structure and content of each message type, such as message identification, length, copy format, and column information, and explains the differences between textual and binary copy formats and their usage in various PostgreSQL operations.