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 1m2Foz-0005lm-Ue for pgsql-hackers@arkaria.postgresql.org; Sat, 10 Jul 2021 16:27:18 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1m2Fox-0002Iu-IP for pgsql-hackers@arkaria.postgresql.org; Sat, 10 Jul 2021 16:27:15 +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 1m2Fow-0002Ih-KH for pgsql-hackers@lists.postgresql.org; Sat, 10 Jul 2021 16:27:15 +0000 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m2Fot-0004a8-Pe for pgsql-hackers@lists.postgresql.org; Sat, 10 Jul 2021 16:27:13 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 9BF123200065; Sat, 10 Jul 2021 12:27:01 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Sat, 10 Jul 2021 12:27:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=hlpRTdcGkMItuH1tP/zBYLrfe4ODo4UAgJuJKYmWnPA=; b=caN4Sa46 4VgkgQEzkkzgG15j3SzrCgyo0fBnqTU9K98nImBHgITkXjtj5lTaYv/401Z202dE HuHz/RuNzq92vs+zdY4FoB4PH15c7NuXSCB2CkTt56aoIZ3U3SJlH7PP+eBLKTXB ApqV0cWyGCDoms6wnjyAmKE8v5wQWox9nsSrWDbYuo0A4UoNK1hhczbuD8owetJm x6pS8809UUsDpWkZPhX8EwzKjHpKZBi4gjW3WorHSnJ/2n8gxYe9oUh22yHzOkcx jcH71LyErg2Eu1nNbNL6hvHw3EQY6JbTjAEVAFTvAmABNTk8qX4waCgAKBC3aRwF HDNcNtrbbA21Sw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrtdekgddutddtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfggtggugfgjsehtkeertddttdejnecuhfhrohhmpeetlhhvrghr ohcujfgvrhhrvghrrgcuoegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhgqe enucggtffrrghtthgvrhhnpeelfeekhffgleetieegjeekvdejvdelhfeuheefvdejheeu teevteejkeeufffgheenucffohhmrghinhepphhoshhtghhrvghsqhhlrdhorhhgpdgvnh htvghrphhrihhsvggusgdrtghomhenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgr mhepmhgrihhlfhhrohhmpegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 10 Jul 2021 12:27:00 -0400 (EDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 288742A09B6; Sat, 10 Jul 2021 12:26:56 -0400 (-04) Date: Sat, 10 Jul 2021 12:26:56 -0400 From: Alvaro Herrera To: Boris Kolpackov Cc: pgsql-hackers@lists.postgresql.org, Michael Paquier , Andrew Dunstan , Peter Geoghegan Subject: Re: Pipeline mode and PQpipelineSync() Message-ID: <202107101626.ktux2aj6npq6@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <202107081815.ne6nsoeox32x@alvherre.pgsql> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2021-Jul-08, Boris Kolpackov wrote: > Alvaro Herrera writes: > > > To be honest, I am hesitant to changing the charter in that way; I fear > > it may have consequences I don't foresee. I think the workaround is not > > *that* bad. > > Ok, fair enough. I've updated my code to account for this and it seems > to be working fine now. Great, thanks. I have pushed the fix, so beta3 (when it is released) should work well for you. https://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=ab09679429009bfed4bd894a6187afde0b7bdfcd > How about the following for the second sentence: > > "In particular, a call to PQisBusy in the middle > of a pipeline returns 0 if all the results for queries issued so far > have been consumed." I used this wording, thanks. On 2021-Jul-08, Alvaro Herrera wrote: > Looking at this again, I noticed that I could probably do away with the > switch on pipelineStatus, and just call pqPipelineProcessQueue in all > cases when appending commands to the queue; I *think* that will do the > right thing in all cases. *Except* that I don't know what will happen > if the program is in the middle of processing a result in single-row > mode, and then sends another query: that would wipe out the pending > results of the query being processed ... but maybe that problem can > already occur in some other way. I tried this and it doesn't work. It doesn't seem interesting to pursue anyway, so I'll just drop the idea. (I did notice that the comment on single-row mode was wrong, though, since pqPipelineProcessQueue does nothing in READY_MORE state, which is what it is in the middle of processing a result.) Thanks for all the help in testing and reviewing, -- Álvaro Herrera 39°49'30"S 73°17'W — https://www.EnterpriseDB.com/ "El hombre nunca sabe de lo que es capaz hasta que lo intenta" (C. Dickens)