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 1lqMTH-0002Cu-IQ for pgsql-hackers@arkaria.postgresql.org; Mon, 07 Jun 2021 21:07:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lqMTG-0002qY-50 for pgsql-hackers@arkaria.postgresql.org; Mon, 07 Jun 2021 21:07:42 +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 1lqMTF-0002qQ-Tk for pgsql-hackers@lists.postgresql.org; Mon, 07 Jun 2021 21:07:41 +0000 Received: from out5-smtp.messagingengine.com ([66.111.4.29]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lqMTE-0001lI-0J for pgsql-hackers@lists.postgresql.org; Mon, 07 Jun 2021 21:07:40 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id A6E4D5C01DD; Mon, 7 Jun 2021 17:07:38 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Mon, 07 Jun 2021 17:07:38 -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=/9k6bK31wJWEmZ6mZ78Q81hyqK9o9c0bpQ7W6n1LvnI=; b=r4WyBwuy ize1kISTHOD2InSXS2rByEHG6/zV1h0PzC9CpNm8a5kcday/2ALBtRh+mgmr+bzC 2jh5a538XbAipiDBexO5qxqaqTTUF3gsMpFT6MFvkoIb3wl6zZKd9CoELnSga1ay 8vzUQ6mY5QydPHVGkhzGsKDUVBeo6ybsLMbeVrx0XFbL4ww58v/EjPTX2HWZDG3z f3AQnIypL2QTFIx0qdcABLURTCQazHCeSwL/499U/orL0ybgR6zEAuOBYtEd+Iwe 8QR0D5LGr4Y7ywPiDeExiW0BImpjb3LT7YOeSTGkY+dFSJw38Z6nEiy5th7tA6YW m+58DJP4j9gamw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrfedtjedgudehiecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpeffhffvuffkgggtugfgjgesthekredttddtjeenucfhrhhomheptehlvhgr rhhoucfjvghrrhgvrhgruceorghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh eqnecuggftrfgrthhtvghrnhepledvgfffvedvieeukeekjedvtdefteeuieejtedtgfeh leefieefueetleduveeunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrg hilhhfrhhomheprghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 7 Jun 2021 17:07:37 -0400 (EDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 8BF2F2A097C; Mon, 7 Jun 2021 17:07:34 -0400 (-04) Date: Mon, 7 Jun 2021 17:07:34 -0400 From: Alvaro Herrera To: Yura Sokolov Cc: Tom Lane , pgsql-hackers@lists.postgresql.org Subject: Re: Add PortalDrop in exec_execute_message Message-ID: <202106072107.d4i55hdscxqj@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <349ddd1e838c30b5efd3b14eb9345ccd@postgrespro.ru> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2021-May-27, Yura Sokolov wrote: > Alvaro Herrera писал 2021-05-26 23:59: > > I don't think they should do that. The portal remains open, and the > > libpq interface does that. The portal gets closed at end of transaction > > without the need for any client message. I think if the client wanted > > to close the portal ahead of time, it would need a new libpq entry point > > to send the message to do that. > > - PQsendQuery issues Query message, and exec_simple_query closes its > portal. > - people doesn't expect PQsendQueryParams to be different from > PQsendQuery aside of parameter sending. The fact that the portal > remains open is a significant, unexpected and undesired difference. > - PQsendQueryGuts is used in PQsendQueryParams and PQsendQueryPrepared. > It is always sends empty portal name and always "send me all rows" > limit (zero). Both usages are certainly to just perform query and > certainly no one expects portal remains open. Thinking about it some more, Yura's argument about PQsendQuery does make sense -- since what we're doing is replacing the use of a 'Q' message just because we can't use it when in pipeline mode, then it is reasonable to think that the replacement ought to have the same behavior. Upon receipt of a 'Q' message, the portal is closed automatically, and ISTM that that behavior should be preserved. That change would not solve the problem he complains about, because IIUC his framework is using PQsendQueryPrepared, which I'm not proposing to change. It just removes the other discrepancy that was discussed in the thread. The attached patch does it. Any opinions? -- Álvaro Herrera Valdivia, Chile "[PostgreSQL] is a great group; in my opinion it is THE best open source development communities in existence anywhere." (Lamar Owen)