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: Sun, 05 Dec 2021 11:01:54 -0500
Message-ID: <2813628.1638720114@sss.pgh.pa.us> (raw)
In-Reply-To: <AAD962D1-48E1-4CA9-9AFD-E6288EFB4A4A@gmx.de>
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>
	<B55956AC-ACB7-4827-9BFD-97F2A9AA606D@gmx.de>
	<36a1a59fcf09deec95b3abdec979d4d6b64a1a4a.camel@cybertec.at>
	<AAD962D1-48E1-4CA9-9AFD-E6288EFB4A4A@gmx.de>

Daniel Frey <d.frey@gmx.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





view thread (10+ messages)  latest in thread

Message-ID: <2813628.1638720114@sss.pgh.pa.us>
Permalink:  ../2813628.1638720114@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2813628.1638720114@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: <2813628.1638720114@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> <B55956AC-ACB7-4827-9BFD-97F2A9AA606D@gmx.de> <36a1a59fcf09deec95b3abdec979d4d6b64a1a4a.camel@cybertec.at> <AAD962D1-48E1-4CA9-9AFD-E6288EFB4A4A@gmx.de> <2813628.1638720114@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