Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mtC8m-00053H-IA for pgsql-general@arkaria.postgresql.org; Fri, 03 Dec 2021 17:14:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mtC8l-0003fh-Dc for pgsql-general@arkaria.postgresql.org; Fri, 03 Dec 2021 17:14:31 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mtC8l-0003fW-3H for pgsql-general@lists.postgresql.org; Fri, 03 Dec 2021 17:14:31 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mtC8i-0001KL-JY for pgsql-general@lists.postgresql.org; Fri, 03 Dec 2021 17:14:30 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 1B3HELkW2311008; Fri, 3 Dec 2021 12:14:22 -0500 From: Tom Lane To: Daniel Frey cc: Laurenz Albe , pgsql-general Subject: Re: libpq: Which functions may hang due to network issues? In-reply-to: <0F84CF07-A88E-41A3-B41D-984EA6385AA2@gmx.de> References: <2B29B70E-2A78-49D3-9861-5DD289DC30DD@gmx.de> <0F84CF07-A88E-41A3-B41D-984EA6385AA2@gmx.de> Comments: In-reply-to Daniel Frey message dated "Fri, 03 Dec 2021 17:25:23 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2311006.1638551661.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Fri, 03 Dec 2021 12:14:21 -0500 Message-ID: <2311007.1638551661@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Daniel Frey writes: >> On 3. Dec 2021, at 17:00, Laurenz Albe 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 commun= ication? >> 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 ar= e that simple. > If this property of a function is not guaranteed by the documentation, h= ow am I expected to write a library that doesn't depend on a specific vers= ion 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