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, Michael Paquier <michael@paquier.xyz>, Andrew Dunstan <andrew@dunslane.net>, Peter Geoghegan <pg@bowt.ie>
Date: 2021-07-08T18:15:49Z
Lists: pgsql-hackers
Looking at this again, I noticed that I could probably do away with the
switch on pipelineStatus, and just call pqPipelineProcessQueue in all
cases when appending commands to the queue; I *think* that will do the
right thing in all cases.  *Except* that I don't know what will happen
if the program is in the middle of processing a result in single-row
mode, and then sends another query: that would wipe out the pending
results of the query being processed ...  but maybe that problem can
already occur in some other way.

I'll have to write some more tests in libpq_pipeline to verify this.

-- 
Álvaro Herrera              Valdivia, Chile  —  https://www.EnterpriseDB.com/
"Java is clearly an example of money oriented programming"  (A. Stepanov)



Commits

  1. libpq: Fix sending queries in pipeline aborted state

  2. Fix libpq state machine in pipeline mode

  3. Add PQsendFlushRequest to libpq