pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Daniel Frey <d.frey@gmx.de>
Cc: Laurenz Albe <laurenz.albe@cybertec.at>
Cc: pgsql-general <pgsql-general@lists.postgresql.org>
Subject: Re: libpq: Which functions may hang due to network issues?
Date: Fri, 03 Dec 2021 12:14:21 -0500
Message-ID: <2311007.1638551661@sss.pgh.pa.us> (raw)
In-Reply-To: <0F84CF07-A88E-41A3-B41D-984EA6385AA2@gmx.de>
References: <2B29B70E-2A78-49D3-9861-5DD289DC30DD@gmx.de>
	<d02a6212477706119f804b9206c32554c77e45fa.camel@cybertec.at>
	<0F84CF07-A88E-41A3-B41D-984EA6385AA2@gmx.de>

Daniel Frey <d.frey@gmx.de> writes:
>> On 3. Dec 2021, at 17:00, Laurenz Albe <laurenz.albe@cybertec.at> wrote:
>> On Fri, 2021-12-03 at 11:37 +0100, Daniel Frey wrote:
>>> Is there a complete list of methods that might wait for network communication?

>> No; you have to read the code.

> I feel that this is insufficient, as the code might change. And it might be simple enought for something like PQstatus(), but not all functions are that simple.

> If this property of a function is not guaranteed by the documentation, how am I expected to write a library that doesn't depend on a specific version of libpq? Could these guarantees be added to the documentation, please?

No.  For one thing, we'd probably forget to maintain any such info.
In any case, I think you'd be best off to assume that anything that
isn't purely local state inspection might try to contact the server.
And it's not hard to see which ones are local state inspection.

			regards, tom lane





view thread (10+ messages)  latest in thread

Message-ID: <2311007.1638551661@sss.pgh.pa.us>
Permalink:  ../2311007.1638551661@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2311007.1638551661@sss.pgh.pa.us

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: tgl@sss.pgh.pa.us, d.frey@gmx.de, laurenz.albe@cybertec.at
  Subject: Re: libpq: Which functions may hang due to network issues?
  In-Reply-To: <2311007.1638551661@sss.pgh.pa.us>
  References: <2B29B70E-2A78-49D3-9861-5DD289DC30DD@gmx.de> <d02a6212477706119f804b9206c32554c77e45fa.camel@cybertec.at> <0F84CF07-A88E-41A3-B41D-984EA6385AA2@gmx.de> <2311007.1638551661@sss.pgh.pa.us>

* 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