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 1llLPD-0002rA-DN for pgsql-hackers@arkaria.postgresql.org; Tue, 25 May 2021 00:58:47 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1llLPC-0001Tz-BP for pgsql-hackers@arkaria.postgresql.org; Tue, 25 May 2021 00:58:46 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1llLPC-0001Tr-2c for pgsql-hackers@lists.postgresql.org; Tue, 25 May 2021 00:58:46 +0000 Received: from mail.postgrespro.ru ([93.174.131.139]) by magus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1llLPA-00074v-7x for pgsql-hackers@lists.postgresql.org; Tue, 25 May 2021 00:58:45 +0000 Received: from mail.postgrespro.ru (cyclops.postgrespro.ru [93.174.131.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mail.postgrespro.ru (Postfix) with ESMTPSA id 2443C21C82E9; Tue, 25 May 2021 03:58:43 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mail; t=1621904323; bh=HIgLhnX/Imy0hzD5uHkm8krlRxe0IF2v2mZoZRCAKs0=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=VBXmPjDjC1LGiizaNYZCCkYd41jGC45CZNKtYtYSBxkymH55FC3ZcIzBAEdt5+Ltx X5akKqYsY8lB6MAAYoPzygqhHwIfVCKj3B4ZJNLLa971DeH46iABA+YpBKp86yPynN /9uQjM3Z3Hr5wxNK3i8uDZ5iZGTjjY4MMJ9a9oLU= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Date: Tue, 25 May 2021 03:58:43 +0300 From: Yura Sokolov To: Tom Lane Cc: pgsql-hackers@lists.postgresql.org Subject: Re: Add PortalDrop in exec_execute_message In-Reply-To: <4160143.1621621400@sss.pgh.pa.us> References: <4aa370cb91ecf2f9885d98b80ad1109c@postgrespro.ru> <4160143.1621621400@sss.pgh.pa.us> User-Agent: Roundcube Webmail/1.4.0 Message-ID: X-Sender: y.sokolov@postgrespro.ru List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Tom Lane писал 2021-05-21 21:23: > Yura Sokolov writes: >> I propose to add PortalDrop at the 'if (completed)' branch of >> exec_execute_message. > > This violates our wire protocol specification, which > specifically says > > If successfully created, a named portal object lasts till the end > of > the current transaction, unless explicitly destroyed. An unnamed > portal is destroyed at the end of the transaction, or as soon as > the > next Bind statement specifying the unnamed portal as destination is > issued. (Note that a simple Query message also destroys the unnamed > portal.) > > I'm inclined to think that your complaint would be better handled > by having the client send a portal-close command, if it's not > going to do something else immediately. I thought about it as well. Then, if I understand correctly, PQsendQueryGuts and PQsendQueryInternal in pipeline mode should send "close portal" (CP) message after "execute" message, right? regards, Sokolov Yura