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 1to3Ga-005Jst-Qs for pgsql-hackers@arkaria.postgresql.org; Fri, 28 Feb 2025 16:31:13 +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 1to3Gb-00A08v-Lb for pgsql-hackers@arkaria.postgresql.org; Fri, 28 Feb 2025 16:31:12 +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 1to3Gb-00A088-Bb for pgsql-hackers@lists.postgresql.org; Fri, 28 Feb 2025 16:31:11 +0000 Received: from dverite2024.planet-service.net ([185.16.44.252] helo=mail.verite.pro) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1to3GT-000CML-1J for pgsql-hackers@postgresql.org; Fri, 28 Feb 2025 16:31:11 +0000 Received: by mail.verite.pro (Postfix, from userid 1000) id C964D2C8540; Fri, 28 Feb 2025 17:31:02 +0100 (CET) Content-Type: text/plain; charset="iso-8859-15" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: Add Pipelining support in psql From: "Daniel Verite" To: "Anthonin Bonnefoy" Cc: Michael Paquier , Jelte Fennema-Nio , PostgreSQL Hackers In-Reply-To: Date: Fri, 28 Feb 2025 17:31:00 +0100 Message-Id: X-Mailer: Manitou v1.7.3 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Anthonin Bonnefoy wrote: > > What is the reasoning here behind this restriction? \gx is a wrapper > > of \g with expanded mode on, but it is also possible to call \g with > > expanded=3Don, bypassing this restriction. >=20 > The issue is that \gx enables expanded mode for the duration of the > query and immediately reset it in sendquery_cleanup. With pipelining, > the command is piped and displaying is done by either \endpipeline or > \getresults, so the flag change has no impact. Forbidding it was a way > to make it clearer that it won't have the expected effect But it's not just \gx The following invocations don't respect the desired output destination and formats (ignoring them), when a pipeline is active: select ... \bind \g filename select ... \bind \g |program select ... \bind \g (format=3Dunaligned tuples_only=3Don) Just like for \gx the problem is that in a pipeline, sending the query is not followed by getting the results, and the output properties of a query are lost in between. Best regards, --=20 Daniel V=E9rit=E9=20 https://postgresql.verite.pro/