Re: Pipeline mode and PQpipelineSync() - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: Pipeline mode and PQpipelineSync()
Date
Msg-id 202106241554.iu62tzrmrywa@alvherre.pgsql
Whole thread Raw
In response to Re: Pipeline mode and PQpipelineSync()  (Boris Kolpackov <boris@codesynthesis.com>)
List pgsql-hackers
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



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [Patch] change the default value of shared_buffers in postgresql.conf.sample
Next
From: Daniel Gustafsson
Date:
Subject: Re: [Patch] change the default value of shared_buffers in postgresql.conf.sample