pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Boris Kolpackov <boris@codesynthesis.com>
To: Alvaro Herrera <alvaro.herrera@2ndquadrant.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: Thu, 8 Jul 2021 17:07:44 +0200
Message-ID: <boris.20210708165230@codesynthesis.com> (raw)
In-Reply-To: <202107081357.xbplnti7szms@alvherre.pgsql>
References: <boris.20210708080714@codesynthesis.com>
	<202107081357.xbplnti7szms@alvherre.pgsql>

Alvaro Herrera <alvaro.herrera@2ndquadrant.com> writes:

> On 2021-Jul-08, Boris Kolpackov wrote:
> 
> > Alvaro Herrera <alvaro.herrera@2ndquadrant.com> writes:
> > 
> > > Hmm ... aren't you trying to read more results than you sent queries?
> > 
> > Hm, but should I be able to? Or, to put another way, should PQisBusy()
> > indicate there is a result available without me sending a query for it?
> > That sounds very counter-intuitive to me.
> 
> That seems a fair complaint, but I think PQisBusy is doing the right
> thing per its charter.  It is documented as "would PQgetResult block?"
> and it is returning correctly that PQgetResult would not block in that
> situation, because no queries are pending.

Well, that's one way to view it. But in this case one can say that
the entire pipeline is still "busy" since we haven't seen the
PQpipelineSync() call. So maybe we could change the charter only
for this special situation (that is, inside the pipeline)?

But I agree, it may not be worth the trouble and a note in the
documentation may be an acceptable "solution".

I am happy to go either way, just let me know what it will be. And
also if the latest patch to libpq that you have shared[1] is still
necessary.

[1] https://www.postgresql.org/message-id/202107061747.tlss7f2somqf%40alvherre.pgsql





view thread (41+ messages)  latest in thread

Message-ID: <boris.20210708165230@codesynthesis.com>
Permalink:  ../boris.20210708165230@codesynthesis.com/
Also on:    postgresql.org/message-id/boris.20210708165230@codesynthesis.com

 · 

reply

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: boris@codesynthesis.com, alvaro.herrera@2ndquadrant.com, michael@paquier.xyz, andrew@dunslane.net, pg@bowt.ie
  Subject: Re: Pipeline mode and PQpipelineSync()
  In-Reply-To: <boris.20210708165230@codesynthesis.com>

* 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