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 1rPaBx-00CeWV-8P for pgsql-hackers@arkaria.postgresql.org; Tue, 16 Jan 2024 03:32:46 +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 1rPaBu-001ASR-86 for pgsql-hackers@arkaria.postgresql.org; Tue, 16 Jan 2024 03:32:42 +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 1rPaBq-001ASJ-SI for pgsql-hackers@lists.postgresql.org; Tue, 16 Jan 2024 03:32:41 +0000 Received: from out5-smtp.messagingengine.com ([66.111.4.29]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rPaBn-001kUk-7d for pgsql-hackers@postgresql.org; Tue, 16 Jan 2024 03:32:36 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 1DD515C00EA; Mon, 15 Jan 2024 22:32:34 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Mon, 15 Jan 2024 22:32:34 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm3; t=1705375954; x=1705462354; bh=HvJ94LrCIb ZJ6BW/ZIaePFHb7AaS39D0IMj6f9R+rgQ=; b=ubC7+rht/SAgrtdKaLYM0huYRN Ou2h65HhFWQGHuxO9hSZq7tqvZDgLzs6wjVxPM3Itdg4/do2/IMRD8/J3g5S26IX hDMa9I3VtLv8400zuKQoDDrC+RvmoHL07aQZnTSrhCcYg0JfvkYZSR2igVK/ZpcN OSpilNRGWrGCwj54G6DrliP2DBp6KVsunQhYRRzq7dupXZFoXOOsgbDc8kU3pL35 TV7V7EG3Ze3rV7kxwqxKJ2T49Ygf7F7T2eS96k+N3C79UaaC6DXNKWzjLff06CHV yQ6Rpxw4AtDEsrgKAkSG4+BjTQOBdN8AZDmFAVWMVs45OOBIEolZNrasjjFw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; t=1705375954; x=1705462354; bh=HvJ94LrCIbZJ6BW/ZIaePFHb7AaS 39D0IMj6f9R+rgQ=; b=lU/B6ab0HHiFm98K0IGVd2o6V0vkJb6L+Rj+DCnJvQyI Mkbi69ABPT3uslOQFiqlxdn0aMJJ3oVmXhPmF4m2f6/l0DY/E189MNZpxWG8MaDJ d8PQMDh+uqGWncaSMWHGXN3d7n0iKB6fMgexHniMZyWqHqGz9P7CSaulhviFqzbK rZVTJZL1Tf2cXAd92ADp/uNIUQDE5VRgG/n5tRI5AjzUxPTw4Z6a7E5/m8E2t6el 9kWHYy74jSbVQDmLsV49OBQYvaPJliQXLJ7vu8h1oKhW1ekGEJ6dLvFG+bXl1tbw KAOESl8sS4kIEJFB0M/uYZ9xz7zoiJxL9SFDk23Mpw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrvdejvddgiedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdljedtmdenucfjughrpeffhffvvefukfhfgggtuggjsehgtderredt tddvnecuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesph grqhhuihgvrhdrgiihiieqnecuggftrfgrthhtvghrnhepteelieefudffhffhtdetleeg geegfffhkeeuveetiefgudduvedutefggeeivdejnecuvehluhhsthgvrhfuihiivgeptd enucfrrghrrghmpehmrghilhhfrhhomhepmhhitghhrggvlhesphgrqhhuihgvrhdrgiih ii X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 15 Jan 2024 22:32:31 -0500 (EST) Date: Tue, 16 Jan 2024 12:32:22 +0900 From: Michael Paquier To: Alvaro Herrera Cc: Jelte Fennema-Nio , Anthonin Bonnefoy , Anton Kirilov , Robert Haas , pgsql-hackers@postgresql.org Subject: Re: Add PQsendSyncMessage() to libpq Message-ID: References: <202401150949.wq7ynlmqxphy@alvherre.pgsql> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="rS2+ijLgHRrNbVax" Content-Disposition: inline In-Reply-To: <202401150949.wq7ynlmqxphy@alvherre.pgsql> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --rS2+ijLgHRrNbVax Content-Type: multipart/mixed; boundary="N5Oy+HUAY7ygRgcX" Content-Disposition: inline --N5Oy+HUAY7ygRgcX Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jan 15, 2024 at 10:49:56AM +0100, Alvaro Herrera wrote: > the new function pqPipelineSyncInternal is not a wrapper for these other > two functions -- the opposite is true actually. We tend to use the term > "workhorse" or "internal workhorse" for this kind of thing. Indeed, makes sense. > In the docs, after this patch we have >=20 > - PQpipelineSync > - PQsendFlushRequest > - PQsendPipelineSync >=20 > Wouldn't it make more sense to add the new function in the middle of the > two existing ones instead? Ordering PQsendPipelineSync just after PQpipelineSync is OK by me. I've applied the patch with all these modifications to move on with the subject. > Looking again at the largish comment that's now atop > pqPipelineSyncInternal(), I think most of it should be removed -- these > things should be explained in the SGML docs, and I think they are, in > the "Using Pipeline Mode" section. We can just have the lines this > patch is adding. Hmm. The first two sentences about being able to submit more commands to the pipeline are documented in the subsection "Issuing Queries". The third sentence is implied in the second paragraph of this subsection. The 4th paragraph of the comment where sync commands cannot be issued until all the results from the pipeline have been consumed is mentioned in the first paragraph in "Using Pipeline Mode". So you are right that this could be entirely removed. How about the attached to remove all that, then? -- Michael --N5Oy+HUAY7ygRgcX Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="libpq-exec-comments.patch" diff --git a/src/interfaces/libpq/fe-exec.c b/src/interfaces/libpq/fe-exec.c index 52d41658c1..152b100624 100644 --- a/src/interfaces/libpq/fe-exec.c +++ b/src/interfaces/libpq/fe-exec.c @@ -3245,23 +3245,6 @@ PQsendPipelineSync(PGconn *conn) /* * Workhorse function for PQpipelineSync and PQsendPipelineSync. * - * It's legal to start submitting more commands in the pipeline immediately, - * without waiting for the results of the current pipeline. There's no need to - * end pipeline mode and start it again. - * - * If a command in a pipeline fails, every subsequent command up to and - * including the result to the Sync message sent by pqPipelineSyncInternal - * gets set to PGRES_PIPELINE_ABORTED state. If the whole pipeline is - * processed without error, a PGresult with PGRES_PIPELINE_SYNC is produced. - * - * Queries can already have been sent before pqPipelineSyncInternal is called, - * but pqPipelineSyncInternal needs to be called before retrieving command - * results. - * - * The connection will remain in pipeline mode and unavailable for new - * synchronous command execution functions until all results from the pipeline - * are processed by the client. - * * immediate_flush controls if the flush happens immediately after sending the * Sync message or not. */ --N5Oy+HUAY7ygRgcX-- --rS2+ijLgHRrNbVax Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmWl+MYACgkQnvQgOdby QH0a4w/9ElgqMHA10ptlmDLiyyUHq2mmcohtTdmvvSVn4VMCTKMpbq5pARtCNW05 8zoKEt0a+qehEziM1gg+CxU9sN5Io4OD3SsAfGaA3ZpqRHcdEvRDmgq9l8vK1WZY m6F39ee4vK7PEbbP0MVn73oOu7C1w5n0PsB+kwKO0UTyBIfVWuAAA0SjYSOlJ+Wf OfBaY9jOLIaq/xr+AS7yiZoadAaDB5zEMYDXuaBSMRQaT/qjz7Ar9Ywn3oN68mzw io+nCOxGPxMxu59VYEgP5uILMpXNGU8YXMCzmVkAWOt4ni7rdS85fZN/jv6tG9me tyxCvQe5zwWeJzD8VukVDxFSQ92P/MMHTS1we9TGWZ31p1txuST3htXNXvoPfeiQ A5eXAC8Ua2xcvZqQ3YxkN8TRTmMC8b60LpejWzxWYpa6/BZcyx/VStaMPUKIlSsn lsb8ZrIpXJwIK9P05x0Zw4VIihNfaIFkWJlaCHM38/swhtlxiyVSUO3f+SGyZKnc ubBNO1XVAsOImktln8nxJ9wWMYL2RcNOwSXs+ECldUPtD/OdbwpBc6B1keypArhS +KKbUJZQ/Q3/xIpy1S5AdTAHX3843ieVgHFwSMU/386JXZD6fW9YLGz8UFUbFIZ0 7tUJUizoU8pXddgdMenprGgsttZHhTv8C/HiYSJiFiUIU35Tvbs= =XUUQ -----END PGP SIGNATURE----- --rS2+ijLgHRrNbVax--