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 1qxs4S-003z0Z-K1 for pgsql-hackers@arkaria.postgresql.org; Tue, 31 Oct 2023 16:58:28 +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 1qxs4R-003U8j-9Z for pgsql-hackers@arkaria.postgresql.org; Tue, 31 Oct 2023 16:58:27 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qxs4R-003U8b-0d for pgsql-hackers@lists.postgresql.org; Tue, 31 Oct 2023 16:58:27 +0000 Received: from momjian.us ([72.94.173.45]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qxs4O-0041GP-Ak for pgsql-hackers@postgresql.org; Tue, 31 Oct 2023 16:58:26 +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=Cn7xrwpnSPNFiSgHXmnA4e2o9lI4fIAbcPXzUuIT0R0=; b=C2Dll OGHHda6wCuLvokds59AkMjh4jenlUkfnuPpztvVHtTU0MU95Pu/mpQ7Az3wsWXp1DBIuYUHjZUYQ6 vKyrHQQ0MEMWWq7hw9SoE3QAA+oPiaOnGNq8GVSkzr9RC9Veoj4I6FhaJGcuvlflTtz4Lnv9/hrGE ltHFZGASKR5UDmm6rw+JD7kdpMaNESqaVZCPkgEF94jBmMDuslkMPCmrnJ7DmAQhjMzQeLszkPz2W JlKvbbajSyDQZxqozl4FxhyKqxtL4s2BT63wkz2nPDZQefa2Xs068Uw/NMwRsS/bJ0MatrYXQ8y57 1eadCtz4yhFkaZtTD9cXlKcYQSKfA==; Received: from bruce by momjian.us with local (Exim 4.96) (envelope-from ) id 1qxs4I-004REb-17; Tue, 31 Oct 2023 12:58:18 -0400 Date: Tue, 31 Oct 2023 12:58:18 -0400 From: Bruce Momjian To: Yugo NAGATA Cc: 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> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="pMSM5/0mbgmR8MSx" Content-Disposition: inline In-Reply-To: <20210721101509.7e70e0f801a4457a2f6a6174@sraoss.co.jp> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --pMSM5/0mbgmR8MSx Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Jul 21, 2021 at 10:15:09AM +0900, Yugo NAGATA wrote: > I understood that, although PQgetResult() also flushes the buffer, we still > should call PQflush() beforehand because we would not like get blocked after > calling PQgetResult(). Thanks. I modified your patch, attached, that I would like to apply to all supported versions. -- Bruce Momjian https://momjian.us EDB https://enterprisedb.com Only you can decide what is important to you. --pMSM5/0mbgmR8MSx 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..d1609ddd9a 100644 --- a/doc/src/sgml/libpq.sgml +++ b/doc/src/sgml/libpq.sgml @@ -5319,8 +5319,8 @@ int PQsetnonblocking(PGconn *conn, int arg); In the nonblocking state, 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. --pMSM5/0mbgmR8MSx--