Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1csrDK-0007E0-TM for pgsql-hackers@arkaria.postgresql.org; Tue, 28 Mar 2017 13:31:11 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1csrDK-0000Tc-3b for pgsql-hackers@arkaria.postgresql.org; Tue, 28 Mar 2017 13:31:10 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1csrBm-00069F-ND for pgsql-hackers@postgresql.org; Tue, 28 Mar 2017 13:29:34 +0000 Received: from verite.pro ([195.154.189.246] helo=genius-map.net) by magus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1csrBf-0004u4-Gw for pgsql-hackers@postgresql.org; Tue, 28 Mar 2017 13:29:34 +0000 Received: by genius-map.net (Postfix, from userid 1001) id EE72938A06A6; Tue, 28 Mar 2017 15:28:55 +0200 (CEST) Content-Type: text/plain; charset="iso-8859-15" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: PATCH: Batch/pipelining support for libpq From: "Daniel Verite" To: "Michael Paquier" Cc: "Vaishnavi Prabakaran" ,"Prabakaran, Vaishnavi" ,"Craig Ringer" ,"Haribabu Kommi" ,"Tsunakawa, Takayuki" ,"Dmitry Igrishin" ,"Andres Freund" ,"PostgreSQL Hackers" ,"Manuel Kniep" ,"fujita.etsuro@lab.ntt.co.jp" ,"Iwata, Aya" In-Reply-To: Date: Tue, 28 Mar 2017 15:28:52 +0200 Message-Id: <5f3810de-df50-49a2-82fa-b95111ef2bbd@manitou-mail.org> X-Mailer: Manitou v1.6.0 X-Pg-Spam-Score: -1.9 (-) 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 Michael Paquier wrote: > # Running: testlibpqbatch dbname=3Dpostgres 10000 copyfailure > dispatching SELECT query failed: cannot queue commands during COPY >=20 > COPYBUF: 5 >=20 > Error status and message got from server due to COPY command failure > are : PGRES_FATAL_ERROR ERROR: unexpected message type 0x50 during > COPY from stdin > CONTEXT: COPY batch_demo, line 1 Same result here. BTW the doc says:=20 "In batch mode only asynchronous operations are permitted, and COPY is not recommended as it most likely will trigger failure in batch processing" Yet it seems that the test assumes that it should work nonetheless. I don't quite understand what we expect of this test, given what's documented. Or what am I missing? While looking at the regress log, I noticed multiple spurious test_singlerowmode tests among the others. Should be fixed with: --- a/src/test/modules/test_libpq/testlibpqbatch.c +++ b/src/test/modules/test_libpq/testlibpqbatch.c @@ -1578,6 +1578,7 @@ main(int argc, char **argv) run_batch_abort =3D 0; run_timings =3D 0; run_copyfailure =3D 0; + run_singlerowmode =3D 0; if (strcmp(argv[3], "disallowed_in_batch") =3D=3D 0) run_disallowed_in_batch =3D 1; else if (strcmp(argv[3], "simple_batch") =3D=3D 0) There's also the fact that this test doesn't care whether it fails=20 (compare with all the "goto fail" of the other tests). And it happens that PQsetSingleRowMode() fails after the call to PQbatchQueueProcess() that instantiates a PGresult of status PGRES_BATCH_END to indicate the end of the batch, To me this shows how this way of setting the single row mode is not ideal. In order to avoid the failure, the loop should know in advance=20 what kind of result it's going to dequeue before calling PQgetResult(), which doesn't feel right. Best regards, --=20 Daniel V=E9rit=E9 PostgreSQL-powered mailer: http://www.manitou-mail.org Twitter: @DanielVerite --=20 Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers