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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Daniel Frey <d(dot)frey(at)gmx(dot)de>
Cc: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, pgsql-general <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: libpq: Which functions may hang due to network issues?
Date: 2021-12-05 16:01:54
Message-ID: 2813628.1638720114@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Daniel Frey <d(dot)frey(at)gmx(dot)de> writes:
> With all that said, I think that PostgreSQL/libpq should have a clear, documented way to get rid of a connection that is guaranteed to not hang. It has something similar for almost all other methods like opening connections, sending request, retrieving results. Why stop there?

AFAICS, PQfinish() already acts that way, at least up to the same level of
guarantee as you have for "all other methods". That is, if you previously
set the connection into nonblock mode, it won't block.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Daniel Frey 2021-12-05 20:32:24 Re: libpq: Which functions may hang due to network issues?
Previous Message Dilip Kumar 2021-12-05 13:26:06 Re: Max connections reached without max connections reached