From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: Boris Kolpackov <boris@codesynthesis.com>
Cc: pgsql-hackers@lists.postgresql.org, Michael Paquier <michael@paquier.xyz>
Cc: Andrew Dunstan <andrew@dunslane.net>
Cc: Peter Geoghegan <pg@bowt.ie>
Subject: Re: Pipeline mode and PQpipelineSync()
Date: Sat, 10 Jul 2021 12:26:56 -0400
Message-ID: <202107101626.ktux2aj6npq6@alvherre.pgsql> (raw)
In-Reply-To: <boris.20210708201732@codesynthesis.com> <202107081815.ne6nsoeox32x@alvherre.pgsql>
On 2021-Jul-08, Boris Kolpackov wrote:
> Alvaro Herrera <alvaro.herrera@2ndquadrant.com> writes:
>
> > To be honest, I am hesitant to changing the charter in that way; I fear
> > it may have consequences I don't foresee. I think the workaround is not
> > *that* bad.
>
> Ok, fair enough. I've updated my code to account for this and it seems
> to be working fine now.
Great, thanks. I have pushed the fix, so beta3 (when it is released)
should work well for you.
https://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=ab09679429009bfed4bd894a6187afde0...> How about the following for the second sentence:
>
> "In particular, a call to <function>PQisBusy</function> in the middle
> of a pipeline returns 0 if all the results for queries issued so far
> have been consumed."
I used this wording, thanks.
On 2021-Jul-08, Alvaro Herrera wrote:
> 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 tried this and it doesn't work. It doesn't seem interesting to
pursue anyway, so I'll just drop the idea. (I did notice that the
comment on single-row mode was wrong, though, since
pqPipelineProcessQueue does nothing in READY_MORE state, which is what
it is in the middle of processing a result.)
Thanks for all the help in testing and reviewing,
--
Álvaro Herrera 39°49'30"S 73°17'W — https://www.EnterpriseDB.com/
"El hombre nunca sabe de lo que es capaz hasta que lo intenta" (C. Dickens)
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: alvherre@alvh.no-ip.org, boris@codesynthesis.com, michael@paquier.xyz, andrew@dunslane.net, pg@bowt.ie
Subject: Re: Pipeline mode and PQpipelineSync()
In-Reply-To: <202107101626.ktux2aj6npq6@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