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)