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 1nRxyq-0004QZ-Ap for pgsql-bugs@arkaria.postgresql.org; Wed, 09 Mar 2022 15:12:00 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nRxyp-0001Zg-39 for pgsql-bugs@arkaria.postgresql.org; Wed, 09 Mar 2022 15:11:59 +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 1nRxyo-0001Z4-RC for pgsql-bugs@lists.postgresql.org; Wed, 09 Mar 2022 15:11:58 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nRxym-00067J-8Z for pgsql-bugs@lists.postgresql.org; Wed, 09 Mar 2022 15:11:58 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 229FBl42515673; Wed, 9 Mar 2022 10:11:47 -0500 From: Tom Lane To: Masahiko Sawada cc: Dmitry Koval , Dilip Kumar , andrewbille@gmail.com, PostgreSQL mailing lists Subject: Re: BUG #17385: "RESET transaction_isolation" inside serializable transaction causes Assert at the transaction end In-reply-to: References: <17385-9ee529fb091f0ce5@postgresql.org> <6e31c4ef-de9a-960b-1a21-e3b6ff0fa9c2@postgrespro.ru> <2733419.1644789029@sss.pgh.pa.us> <2778050.1644817168@sss.pgh.pa.us> <3054063.1644944122@sss.pgh.pa.us> Comments: In-reply-to Masahiko Sawada message dated "Wed, 09 Mar 2022 11:26:42 +0900" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <515671.1646838707.1@sss.pgh.pa.us> Date: Wed, 09 Mar 2022 10:11:47 -0500 Message-ID: <515672.1646838707@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Masahiko Sawada writes: > On Wed, Feb 16, 2022 at 1:55 AM Tom Lane wrote: >> Yeah, I was considering that too. A new GUC_NO_RESET flag would be >> cheaper than running the check hooks during RESET, and probably >> safer too. On the other hand, we would lose the property that >> you can reset these settings as long as you've not yet taken a >> snapshot. I wonder whether there is any code out there that >> depends on that ... > Indeed. I guess that it's relatively common that the transaction > isolation level is set after BEGIN TRANSACTION but I've not heard that > it's reset after BEGIN TRANSACTION with setting non-default > transaction isolation level. Yes, we certainly have to preserve the SET case, but using RESET in that way seems like it'd be pretty weird coding. I'd have no hesitation about banning it in a HEAD-only change. I'm slightly more nervous about doing so in a back-patched bug fix. On the other hand, starting to call check hooks in a context that did not use them before is also scary to back-patch. Do you want to draft up a patch that fixes this with a new GUC flag? regards, tom lane