Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bhBTs-0000vm-Ks for pgsql-hackers@arkaria.postgresql.org; Tue, 06 Sep 2016 08:11:44 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bhBTr-0002RK-HD for pgsql-hackers@arkaria.postgresql.org; Tue, 06 Sep 2016 08:11:43 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bhBST-0000EF-9F for pgsql-hackers@postgresql.org; Tue, 06 Sep 2016 08:10:17 +0000 Received: from [2001:41d0:2:9c82::1] (helo=ks311736.kimsufi.com) by makus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bhBSP-0004Hy-VG for pgsql-hackers@postgresql.org; Tue, 06 Sep 2016 08:10:16 +0000 Received: from genius-map.net (verite.pro [195.154.189.246]) by ks311736.kimsufi.com (Postfix) with ESMTP id ED8E5C0CA6; Tue, 6 Sep 2016 10:35:38 +0200 (CEST) Received: by genius-map.net (Postfix, from userid 1001) id D11E638A02FD; Tue, 6 Sep 2016 10:10:10 +0200 (CEST) MIME-Version: 1.0 Subject: Re: PATCH: Batch/pipelining support for libpq From: "Daniel Verite" To: "Craig Ringer" Cc: "Michael Paquier" ,"Dmitry Igrishin" ,"Andres Freund" ,"PostgreSQL Hackers" ,"Manuel Kniep" ,"fujita.etsuro@lab.ntt.co.jp" In-Reply-To: Date: Tue, 06 Sep 2016 10:10:08 +0200 Message-Id: X-Mailer: Manitou v1.5.1 Content-type: multipart/mixed; boundary="----------=_1473149410-12528-19" X-Host-Lookup-Failed: Reverse DNS lookup failed for 2001:41d0:2:9c82::1 (failed) X-Pg-Spam-Score: -1.1 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org This is a multi-part message in MIME format... ------------=_1473149410-12528-19 Content-Type: text/plain; charset="iso-8859-15" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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 !=3D 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, --=20 Daniel V=E9rit=E9 PostgreSQL-powered mailer: http://www.manitou-mail.org Twitter: @DanielVerite ------------=_1473149410-12528-19 Content-Type: text/plain; name="diff-typos.txt" Content-Disposition: attachment; filename="diff-typos.txt" Content-Transfer-Encoding: 7bit diff --git a/doc/src/sgml/libpq.sgml b/doc/src/sgml/libpq.sgml index 73c6c03..af4f922 100644 --- a/doc/src/sgml/libpq.sgml +++ b/doc/src/sgml/libpq.sgml @@ -4653,7 +4653,7 @@ int PQflush(PGconn *conn); could be much more efficiently done with: - UPDATE mytable SET x = x + 1; + UPDATE mytable SET x = x + 1 WHERE id = 42; @@ -4696,7 +4696,7 @@ int PQflush(PGconn *conn); non-blocking mode. 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); 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 PQgetNextQuery has to be called before the query queue is empty again. @@ -5037,7 +5037,7 @@ int PQqueriesInBatch(PGconn *conn); - Returns 1 if the batch curently being received on a + Returns 1 if the batch currently being received on a libpq connection in batch mode is aborted, 0 ------------=_1473149410-12528-19 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers ------------=_1473149410-12528-19--