From: Daniel Verite <daniel@manitou-mail.org>
To: Craig Ringer <craig@2ndquadrant.com>
Cc: Michael Paquier <michael.paquier@gmail.com>
Cc: Dmitry Igrishin <dmitigr@gmail.com>
Cc: Andres Freund <andres@anarazel.de>
Cc: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Cc: Manuel Kniep <m.kniep@web.de>
Cc: fujita.etsuro@lab.ntt.co.jp <fujita.etsuro@lab.ntt.co.jp>
Subject: Re: PATCH: Batch/pipelining support for libpq
Date: Tue, 06 Sep 2016 10:10:08 +0200
Message-ID: <e8caca78-b3ee-436a-a5e9-d2f971a34cbf@mm> (raw)
In-Reply-To: <CAMsr+YF5KKoEQOfqGdhvX0XLRaXz8vtS=yV7xoPFw+=YmDTwoA@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>
Craig Ringer wrote:
> Updated patch attached.
Please find attached a couple fixes for typos I've came across in
the doc part.
Also it appears that PQqueriesInBatch() doesn't work as documented.
It says:
"Returns the number of queries still in the queue for this batch"
but in fact it's implemented as a boolean:
+/* PQqueriesInBatch
+ * Return true if there are queries currently pending in batch mode
+ */+int
+PQqueriesInBatch(PGconn *conn)
+{
+ if (!PQisInBatchMode(conn))
+ return false;
+
+ return conn->cmd_queue_head != NULL;
+}
However, is this function really needed? It doesn't seem essential to
the API. You don't call it in the test program either.
Best regards,
--
Daniel Vérité
PostgreSQL-powered mailer: http://www.manitou-mail.org
Twitter: @DanielVerite
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackersAttachments:diff-typos.txt (text/plain, 1.9K) downloaddiff --git a/doc/src/sgml/libpq.sgml b/doc/src/sgml/libpq.sgmlindex 73c6c03..af4f922 100644--- a/doc/src/sgml/libpq.sgml+++ b/doc/src/sgml/libpq.sgml@@ -4653,7 +4653,7 @@ int PQflush(PGconn *conn);
</programlisting>
could be much more efficiently done with:
<programlisting>
- UPDATE mytable SET x = x + 1;+ UPDATE mytable SET x = x + 1 WHERE id = 42;
</programlisting>
</para>
@@ -4696,7 +4696,7 @@ int PQflush(PGconn *conn);
<link linkend="libpq-pqsetnonblocking">non-blocking mode</link>. If used in
blocking mode it is possible for a client/server deadlock to occur. The
client will block trying to send queries to the server, but the server will
- block trying to send results from queries it's already processed to the+ block trying to send results from queries it has already processed to the
client. This only occurs when the client sends enough queries to fill its
output buffer and the server's receive buffer before switching to
processing input from the server, but it's hard to predict exactly when
@@ -5015,7 +5015,7 @@ int PQgetNextQuery(PGconn *conn);
<listitem>
<para>
Returns the number of queries still in the queue for this batch, not
- including any query that's currently having results being processsed.+ including any query that's currently having results being processed.
This is the number of times <function>PQgetNextQuery</function> has to be
called before the query queue is empty again.
@@ -5037,7 +5037,7 @@ int PQqueriesInBatch(PGconn *conn);
<listitem>
<para>
- Returns 1 if the batch curently being received on a+ Returns 1 if the batch currently being received on a
<application>libpq</application> connection in <link
linkend="libpq-batch-mode">batch mode</link> is
<link linkend="libpq-batch-errors">aborted</link>, 0
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: daniel@manitou-mail.org, craig@2ndquadrant.com, michael.paquier@gmail.com, dmitigr@gmail.com, andres@anarazel.de, m.kniep@web.de, fujita.etsuro@lab.ntt.co.jp
Subject: Re: PATCH: Batch/pipelining support for libpq
In-Reply-To: <e8caca78-b3ee-436a-a5e9-d2f971a34cbf@mm>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox