Home Explore Blog CI



postgresql

84th chunk of `doc/src/sgml/libpq.sgml`
b48d7ab3ad50c5a10cf9b9fe45a1b6f2baee6c0fba274e790000000100000fa2
 </listitem>
    </varlistentry>

    <varlistentry id="libpq-PQenterPipelineMode">
     <term><function>PQenterPipelineMode</function><indexterm><primary>PQenterPipelineMode</primary></indexterm></term>

     <listitem>
      <para>
      Causes a connection to enter pipeline mode if it is currently idle or
      already in pipeline mode.

<synopsis>
int PQenterPipelineMode(PGconn *conn);
</synopsis>

      </para>
      <para>
       Returns 1 for success.
       Returns 0 and has no effect if the connection is not currently
       idle, i.e., it has a result ready, or it is waiting for more
       input from the server, etc.
       This function does not actually send anything to the server,
       it just changes the <application>libpq</application> connection
       state.
      </para>
     </listitem>
    </varlistentry>

    <varlistentry id="libpq-PQexitPipelineMode">
     <term><function>PQexitPipelineMode</function><indexterm><primary>PQexitPipelineMode</primary></indexterm></term>

     <listitem>
      <para>
       Causes a connection to exit pipeline mode if it is currently in pipeline mode
       with an empty queue and no pending results.
<synopsis>
int PQexitPipelineMode(PGconn *conn);
</synopsis>
      </para>
      <para>
       Returns 1 for success.  Returns 1 and takes no action if not in
       pipeline mode. If the current statement isn't finished processing,
       or <function>PQgetResult</function> has not been called to collect
       results from all previously sent query, returns 0 (in which case,
       use <xref linkend="libpq-PQerrorMessage"/> to get more information
       about the failure).
      </para>
     </listitem>
    </varlistentry>

    <varlistentry id="libpq-PQpipelineSync">
     <term><function>PQpipelineSync</function><indexterm><primary>PQpipelineSync</primary></indexterm></term>

     <listitem>
      <para>
       Marks a synchronization point in a pipeline by sending a
       <link linkend="protocol-flow-ext-query">sync message</link>
       and flushing the send buffer. This serves as
       the delimiter of an implicit transaction and an error recovery
       point; see <xref linkend="libpq-pipeline-errors"/>.

<synopsis>
int PQpipelineSync(PGconn *conn);
</synopsis>
      </para>
      <para>
       Returns 1 for success. Returns 0 if the connection is not in
       pipeline mode or sending a
       <link linkend="protocol-flow-ext-query">sync message</link>
       failed.
      </para>
     </listitem>
    </varlistentry>

    <varlistentry id="libpq-PQsendPipelineSync">
     <term><function>PQsendPipelineSync</function><indexterm><primary>PQsendPipelineSync</primary></indexterm></term>

     <listitem>
      <para>
       Marks a synchronization point in a pipeline by sending a
       <link linkend="protocol-flow-ext-query">sync message</link>
       without flushing the send buffer. This serves as
       the delimiter of an implicit transaction and an error recovery
       point; see <xref linkend="libpq-pipeline-errors"/>.

<synopsis>
int PQsendPipelineSync(PGconn *conn);
</synopsis>
      </para>
      <para>
       Returns 1 for success. Returns 0 if the connection is not in
       pipeline mode or sending a
       <link linkend="protocol-flow-ext-query">sync message</link>
       failed.
       Note that the message is not itself flushed to the server automatically;
       use <function>PQflush</function> if necessary.
      </para>
     </listitem>
    </varlistentry>

    <varlistentry id="libpq-PQsendFlushRequest">
     <term><function>PQsendFlushRequest</function><indexterm><primary>PQsendFlushRequest</primary></indexterm></term>

     <listitem>
      <para>
       Sends a request for the server to flush its output buffer.
<synopsis>
int PQsendFlushRequest(PGconn *conn);
</synopsis>
      </para>

      <para>
       Returns 1 for success.  Returns 0 on any failure.
      </para>
      <para>
       The server flushes its output buffer automatically as a result

Title: libpq Pipeline Functions (Continued): Exiting Pipeline Mode, Synchronization, and Flush Requests
Summary
Continuing the description of libpq pipeline functions, this section covers `PQexitPipelineMode`, which exits pipeline mode if the queue is empty and there are no pending results; `PQpipelineSync`, which sends a sync message and flushes the send buffer to mark a synchronization point; `PQsendPipelineSync`, similar to `PQpipelineSync` but without automatically flushing the buffer; and `PQsendFlushRequest`, which requests the server to flush its output buffer.