Home Explore Blog CI



postgresql

58th chunk of `doc/src/sgml/protocol.sgml`
a78c5cd4cfb3c009ed32df9b9cfb8ebadb79845086e6e4ed0000000100000fa0
 the tag is
        <literal>COPY <replaceable>rows</replaceable></literal> where
        <replaceable>rows</replaceable> is the number of rows copied.
        (Note: the row count appears only in
        <productname>PostgreSQL</productname> 8.2 and later.)
       </para>
       </listitem>
      </varlistentry>
     </variablelist>
    </listitem>
   </varlistentry>

   <varlistentry id="protocol-message-formats-CopyData">
    <term>CopyData (F &amp; B)</term>
    <listitem>
     <variablelist>
      <varlistentry>
       <term>Byte1('d')</term>
       <listitem>
        <para>
         Identifies the message as <command>COPY</command> data.
        </para>
       </listitem>
      </varlistentry>

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

      <varlistentry>
       <term>Byte<replaceable>n</replaceable></term>
       <listitem>
        <para>
         Data that forms part of a <command>COPY</command> data stream.  Messages sent
         from the backend will always correspond to single data rows,
         but messages sent by frontends might divide the data stream
         arbitrarily.
        </para>
       </listitem>
      </varlistentry>
     </variablelist>
    </listitem>
   </varlistentry>

   <varlistentry id="protocol-message-formats-CopyDone">
    <term>CopyDone (F &amp; B)</term>
    <listitem>
     <variablelist>
      <varlistentry>
       <term>Byte1('c')</term>
       <listitem>
        <para>
         Identifies the message as a <command>COPY</command>-complete indicator.
        </para>
       </listitem>
      </varlistentry>

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

   <varlistentry id="protocol-message-formats-CopyFail">
    <term>CopyFail (F)</term>
    <listitem>
     <variablelist>
      <varlistentry>
       <term>Byte1('f')</term>
       <listitem>
        <para>
         Identifies the message as a <command>COPY</command>-failure indicator.
        </para>
       </listitem>
      </varlistentry>
      <varlistentry>
       <term>Int32</term>
       <listitem>
        <para>
         Length of message contents in bytes, including self.
        </para>
       </listitem>
      </varlistentry>

      <varlistentry>
       <term>String</term>
       <listitem>
        <para>
         An error message to report as the cause of failure.
        </para>
       </listitem>
      </varlistentry>
     </variablelist>
    </listitem>
   </varlistentry>

   <varlistentry id="protocol-message-formats-CopyInResponse">
    <term>CopyInResponse (B)</term>
    <listitem>
     <variablelist>
      <varlistentry>
       <term>Byte1('G')</term>
       <listitem>
        <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>
      

Title: Protocol Message Formats for COPY Operations
Summary
This section describes the message formats for various COPY operations, including CopyData, CopyDone, CopyFail, and CopyInResponse, detailing the structure and content of each message type, such as data identification, length, and error messages, and explains the differences between textual and binary copy formats.