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

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.  I think we would regret
changing PQisBusy in the way you suggest.

I think your expectation is that we would have an entry point for easy
iteration; a way to say "if there's a result set to be had, can I have
it please, otherwise I'm done iterating".  That seems a reasonable ask,
but PQisBusy is not that.  Maybe it would be PQisResultPending() or
something like that.  I again have to ask the RMT what do they think of
adding such a thing to libpq this late in the cycle.

-- 
Álvaro Herrera           39°49'30"S 73°17'W  —  https://www.EnterpriseDB.com/





view thread (41+ messages)  latest in thread

Message-ID: <202107081357.xbplnti7szms@alvherre.pgsql>
Permalink:  ../202107081357.xbplnti7szms@alvherre.pgsql/
Also on:    postgresql.org/message-id/202107081357.xbplnti7szms@alvherre.pgsql

 · 

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