Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qxw6j-004Uw2-Ks for pgsql-hackers@arkaria.postgresql.org; Tue, 31 Oct 2023 21:17:05 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qxw6i-004QOd-1J for pgsql-hackers@arkaria.postgresql.org; Tue, 31 Oct 2023 21:17:04 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qxw6h-004QOV-IW for pgsql-hackers@lists.postgresql.org; Tue, 31 Oct 2023 21:17:03 +0000 Received: from momjian.us ([72.94.173.45]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qxw6e-003LQ3-Pk for pgsql-hackers@postgresql.org; Tue, 31 Oct 2023 21:17:02 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=momjian.us; s=2023062407; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description; bh=Y5LCJ8ceiiqEJefQoZ3QFKrcLxWwLoEYx6d9qjP+D+4=; b=uRgHY VIP48QAMMiVqg1TtxEG5HfZFghUAniRCaWD5ASUyt7HYqTF0L/yaH8s87ZkYOhIAMHqFNdTCC/1Tj Wzv78es663vpJFAyQV5zPCrjJCiW7buYJ7ZSgUUAogHX34m5yiyUugaG1p0WaDxHpmKwQkyr4tvwi pdqcZ7as4UCAswk2msCio8Bfp6ImzkmR4FdkS2hTePjOEPKWB477MY/FddRLOj3G68WmWSZ4YMELl sygizIEkaLGRm5xaNF5E555gAsuENcTgRgyAa21tUnGJpy+97MmMk4L5QeHzPXnMhckITpa5CCoKA uTCIhO/h6kv35DLWon/cqHYoZHiQg==; Received: from bruce by momjian.us with local (Exim 4.96) (envelope-from ) id 1qxw6a-004xJB-0H; Tue, 31 Oct 2023 17:16:56 -0400 Date: Tue, 31 Oct 2023 17:16:56 -0400 From: Bruce Momjian To: Tom Lane Cc: Yugo NAGATA , Alvaro Herrera , pgsql-hackers@postgresql.org Subject: Re: Question about non-blocking mode in libpq Message-ID: References: <20210719231129.b2ab655c0d0e80545274c86f@sraoss.co.jp> <202107201605.b3hmz4g6uqqz@alvherre.pgsql> <20210721101509.7e70e0f801a4457a2f6a6174@sraoss.co.jp> <2604997.1698775114@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="9rw9Tujx63ckXlbu" Content-Disposition: inline In-Reply-To: <2604997.1698775114@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --9rw9Tujx63ckXlbu Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Oct 31, 2023 at 01:58:34PM -0400, Tom Lane wrote: > Bruce Momjian writes: > > I modified your patch, attached, that I would like to apply to all > > supported versions. > > This seems to have lost the information about what to do if these > functions fail. I think probably the only possible failure cause > in nonblock mode is "unable to enlarge the buffer because OOM", > but that's certainly not the same thing as "cannot fail". Okay, I added "_successful_ calls", attached. I am not sure what else to add. -- Bruce Momjian https://momjian.us EDB https://enterprisedb.com Only you can decide what is important to you. --9rw9Tujx63ckXlbu Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="block.diff" diff --git a/doc/src/sgml/libpq.sgml b/doc/src/sgml/libpq.sgml index 64b2910fee..9e0563d7ca 100644 --- a/doc/src/sgml/libpq.sgml +++ b/doc/src/sgml/libpq.sgml @@ -5316,11 +5316,11 @@ int PQsetnonblocking(PGconn *conn, int arg); - In the nonblocking state, calls to + In the nonblocking state, successful calls to , , , , - and will not block but instead return - an error if they need to be called again. + and will not block; their changes + are stored in the local output buffer until they are flushed. --9rw9Tujx63ckXlbu--