Re: Pipeline mode and PQpipelineSync()
Alvaro Herrera <alvaro.herrera@2ndquadrant.com>
From: Alvaro Herrera <alvaro.herrera@2ndquadrant.com>
To: Boris Kolpackov <boris@codesynthesis.com>
Cc: pgsql-hackers@lists.postgresql.org
Date: 2021-06-23T16:22:46Z
Lists: pgsql-hackers
On 2021-Jun-23, Boris Kolpackov wrote: > I think one change that is definitely needed is to make it clear that > the PQpipelineSync() call is not optional. > > I would also add a note saying that while the server starts processing > the pipeline immediately, it may buffer the results and the only way > to flush them out is to call PQpipelineSync(). Curious -- I just noticed that the server understands a message 'H' that requests a flush of the server buffer. However, libpq has no way to generate that message as far as I can see. I think you could use that to request results from the pipeline, without the sync point. I wonder if it's worth adding an entry point to libpq to allow access to this. PQrequestFlush() or something like that ... Prior to pipeline mode this has no use (since everything ends with ReadyForQuery which involves a flush) but it does seem to have use in pipeline mode. -- Álvaro Herrera 39°49'30"S 73°17'W
Commits
-
libpq: Fix sending queries in pipeline aborted state
- ab0967942900 15.0 landed
- 1beaa654da61 14.0 landed
-
Fix libpq state machine in pipeline mode
- b71a9cb31e46 15.0 landed
- 690339fcd587 14.0 landed
-
Add PQsendFlushRequest to libpq
- a7192326c74d 15.0 landed
- 69cf1d5429d4 14.0 landed