diff --git a/doc/src/sgml/libpq.sgml b/doc/src/sgml/libpq.sgml
index d829a4b..4e0431e 100644
--- a/doc/src/sgml/libpq.sgml
+++ b/doc/src/sgml/libpq.sgml
@@ -3947,9 +3947,14 @@ int PQsendQuery(PGconn *conn, const char *command);
 
        After successfully calling <function>PQsendQuery</function>, call
        <function>PQgetResult</function> one or more times to obtain the
-       results.  <function>PQsendQuery</function> cannot be called again
-       (on the same connection) until <function>PQgetResult</function>
-       has returned a null pointer, indicating that the command is done.
+       results.  If pipelining is enabled <function>PQsendQuery</function>
+       may be called multiple times before reading the results. See 
+       <function>PQsetPipelining</function> and <function>PQisPipelining</function>.
+       Call <function>PQgetSentQuery</function> to get a <structname>PGquery</structname>
+       which can be used to identify which results obtained from
+       <function>PQgetResult</function> belong to each pipelined query.
+       If only one query is dispatched at a time, you can call <function>PQgetResult</function>
+       until a NULL value is returned to indicate the end of the query.
       </para>
      </listitem>
     </varlistentry>
@@ -4133,8 +4138,8 @@ PGresult *PQgetResult(PGconn *conn);
 
       <para>
        <function>PQgetResult</function> must be called repeatedly until
-       it returns a null pointer, indicating that the command is done.
-       (If called when no command is active,
+       it returns a null pointer, indicating that all dispatched commands
+       are done. (If called when no command is active,
        <function>PQgetResult</function> will just return a null pointer
        at once.) Each non-null result from
        <function>PQgetResult</function> should be processed using the
@@ -4144,14 +4149,17 @@ PGresult *PQgetResult(PGconn *conn);
        <function>PQgetResult</function> will block only if a command is
        active and the necessary response data has not yet been read by
        <function>PQconsumeInput</function>.
+       If query pipelining is being used, <function>PQgetResultQuery</function>
+       can be called after PQgetResult to match the result to the query.
       </para>
 
       <note>
        <para>
         Even when <function>PQresultStatus</function> indicates a fatal
-        error, <function>PQgetResult</function> should be called until it
-        returns a null pointer, to allow <application>libpq</> to
-        process the error information completely.
+        error, <function>PQgetResult</function> should be called until the
+        query has no more results (null pointer return if not using query
+        pipelining, otherwise see <function>PQgetResultQuery</function>),
+        to allow <application>libpq</> to process the error information completely.
        </para>
       </note>
      </listitem>
@@ -4385,6 +4393,158 @@ int PQflush(PGconn *conn);
    read-ready and then read the response as described above.
   </para>
 
+ <variablelist>
+  <varlistentry id="libpq-pqsetpipelining">
+   <term>
+    <function>PQsetPipelining</function>
+    <indexterm>
+     <primary>PQsetPipelining</primary>
+    </indexterm>
+   </term>
+
+   <listitem>
+    <para>
+     Enables or disables query pipelining.
+<synopsis>
+int PQsetPipelining(PGconn *conn, int arg);
+</synopsis>
+    </para>
+
+    <para>
+     Enables pipelining for the connectino if arg is 1, or disables it
+     if arg is 0.  When pipelining is enabled multiple async queries can
+     be sent before processing the results of the first.  If pipelining
+     is disabled an error will be raised an async query is attempted
+     while another is active.
+    </para>
+   </listitem>
+  </varlistentry>
+
+  <varlistentry id="libpq-pqispipelining">
+   <term>
+    <function>PQisPipelining</function>
+    <indexterm>
+     <primary>PQisPipelining</primary>
+    </indexterm>
+   </term>
+
+   <listitem>
+    <para>
+     Returns the pipelining status of the connection
+<synopsis>
+int PQisPipelining(PGconn *conn);
+</synopsis>
+    </para>
+
+    <para>
+     Returns 1 if pipelining is enabled, or 0 if pipeling is disabled.
+     Query pipelining is disabled unless enabled with a call to
+     <function>PQsetPipelining</function>.
+    </para>
+   </listitem>
+  </varlistentry>
+
+  <varlistentry id="libpq-pqgetquerycommand">
+   <term>
+    <function>PQgetQueryCommand</function>
+    <indexterm>
+     <primary>PQgetQueryCommand</primary>
+    </indexterm>
+   </term>
+
+   <listitem>
+    <para>
+     Returns the query string associated with the <structure>PGquery</structure>.
+<synopsis>
+const char * PQgetQueryCommand(PGquery *query);
+</synopsis>
+    </para>
+
+    <para>
+     When using query pipelining this function can be used to retrieve the command
+     that created the query object.
+    </para>
+   </listitem>
+  </varlistentry>
+
+  <varlistentry id="libpq-pqgetresultquery">
+   <term>
+    <function>PQgetResultQuery</function>
+    <indexterm>
+     <primary>PQgetResultQuery</primary>
+    </indexterm>
+   </term>
+
+   <listitem>
+    <para>
+     Returns the first async query to recieve results, or NULL if no
+     async queries are active.
+<synopsis>
+PGquery * PQgetResultQuery(PGconn *conn);
+</synopsis>
+    </para>
+
+    <para>
+     When pipelining queries this function indicates which query the
+     result of <function>PQgetResult</function> results from.
+     Call this function immediately after calling 
+     <function>PQgetResult</function>, or immediately before if a result
+     is ready to read, indicated by <function>PQisBusy</function>
+     being false.  The <structure>PGquery</structure> remains valid
+     until the next libpq call that consumes input.
+    </para>
+   </listitem>
+  </varlistentry>
+
+  <varlistentry id="libpq-pqgetnextquery">
+   <term>
+    <function>PQgetNextQuery</function>
+    <indexterm>
+     <primary>PQgetNextQuery</primary>
+    </indexterm>
+   </term>
+
+   <listitem>
+    <para>
+     Returns the next <structure>PGquery</structure> in the list of
+     pipelined queries.
+<synopsis>
+PGquery * PQgetNextQuery(PGquery *query);
+</synopsis>
+    </para>
+
+    <para>
+     This function can be used to iterate each pending async query,
+     starting with <function>PQgetResultQuery</function>
+     and ending with <function>PQgetSentQuery</function>.
+    </para>
+   </varlistentry>
+
+   <varlistentry>
+    <term>
+     <function>PQgetSentQuery</function>
+     <indexterm>
+      <primary>PQgetSentQuery</primary>
+     </indexterm>
+    </term>
+
+    <listitem>
+     <para>
+      Returns the last <structure>PGquery</structure> in the list of
+      dispatched async queries waiting for results.
+<synopsis>
+PGquery * PQgetSentQuery(PGquery *query);
+</synopsis>
+     </para>
+
+     <para>
+      Call this function after dispatching an async query to get
+      a <structure>PGquery</structure> that can be used to identify
+      the originating query for each result obtained by
+      <function>PGgetResult</function>.
+     </para>
+   </varlistentry>
+  </variablelist>
  </sect1>
 
  <sect1 id="libpq-single-row-mode">
@@ -4411,7 +4571,7 @@ int PQflush(PGconn *conn);
    immediately after a successful call of <function>PQsendQuery</function>
    (or a sibling function).  This mode selection is effective only for the
    currently executing query.  Then call <function>PQgetResult</function>
-   repeatedly, until it returns null, as documented in <xref
+   repeatedly, until the last query result is returned, as documented in <xref
    linkend="libpq-async">.  If the query returns any rows, they are returned
    as individual <structname>PGresult</structname> objects, which look like
    normal query results except for having status code
@@ -4420,8 +4580,8 @@ int PQflush(PGconn *conn);
    the query returns zero rows, a zero-row object with status
    <literal>PGRES_TUPLES_OK</literal> is returned; this is the signal that no
    more rows will arrive.  (But note that it is still necessary to continue
-   calling <function>PQgetResult</function> until it returns null.)  All of
-   these <structname>PGresult</structname> objects will contain the same row
+   calling <function>PQgetResult</function> until the last query result is returned.)
+   All of these <structname>PGresult</structname> objects will contain the same row
    description data (column names, types, etc) that an ordinary
    <structname>PGresult</structname> object for the query would have.
    Each object should be freed with <function>PQclear</function> as usual.