From: Alvaro Herrera <alvaro.herrera@2ndquadrant.com>
To: Boris Kolpackov <boris@codesynthesis.com>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: Pipeline mode and PQpipelineSync()
Date: Thu, 24 Jun 2021 11:54:50 -0400
Message-ID: <202106241554.iu62tzrmrywa@alvherre.pgsql> (raw)
In-Reply-To: <boris.20210623100839@codesynthesis.com>
On 2021-Jun-23, Boris Kolpackov wrote:
> If, however, I execute it by checking for results before sending the
> next INSERT, I get the following call sequence:
>
> PQsendQueryPrepared() # INSERT #1
> PQflush()
> PQsendQueryPrepared() # INSERT #2
> PQflush()
> ...
> PQsendQueryPrepared() # INSERT #~400
> PQflush()
> PQconsumeInput() # At this point select() indicates we can read.
> PQgetResult() # NULL (???)
> PQgetResult() # INSERT #1
> PQgetResult() # NULL
> PQgetResult() # INSERT #2
> PQgetResult() # NULL
> ...
>
>
> What's strange here is that the first PQgetResult() call (marked with ???)
> returns NULL instead of result for INSERT #1 as in the first call sequence.
> Interestingly, if I skip it, the rest seems to progress as expected.
Yeah, I agree that there's a problem in the libpq state machine. I'm
looking into it now.
--
Álvaro Herrera 39°49'30"S 73°17'W
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: alvaro.herrera@2ndquadrant.com, boris@codesynthesis.com, pgsql-hackers@lists.postgresql.org
Subject: Re: Pipeline mode and PQpipelineSync()
In-Reply-To: <202106241554.iu62tzrmrywa@alvherre.pgsql>
* 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