Re: libpq: Which functions may hang due to network issues?

From: Daniel Frey <d(dot)frey(at)gmx(dot)de>
To: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
Cc: pgsql-general <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: libpq: Which functions may hang due to network issues?
Date: 2021-12-03 16:25:23
Message-ID: 0F84CF07-A88E-41A3-B41D-984EA6385AA2@gmx.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> On 3. Dec 2021, at 17:00, Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at> wrote:
>
> On Fri, 2021-12-03 at 11:37 +0100, Daniel Frey wrote:
>> I need to know which functions of libpq may "hang", depending on network issues. For some functions is
>> seems to be clear, as they only work locally, other functions are clearly documented to wait on some
>> network interaction. But for some functions, it is unclear on whether they are guaranteed to work
>> locally without any possibility to hang or not, e.g. PQfinish(), PQstatus(), PQtransactionStatus(), etc.
>>
>> 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?

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2021-12-03 16:30:08 Re: SUM() of INTERVAL type produces INTERVAL with no precision
Previous Message Sebastien Flaesch 2021-12-03 16:12:36 Re: SUM() of INTERVAL type produces INTERVAL with no precision