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 1nJU5H-0002v6-32 for pgsql-bugs@arkaria.postgresql.org; Mon, 14 Feb 2022 05:39:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nJU5F-0007tL-CJ for pgsql-bugs@arkaria.postgresql.org; Mon, 14 Feb 2022 05:39:33 +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 1nJU5F-0007mM-3b for pgsql-bugs@lists.postgresql.org; Mon, 14 Feb 2022 05:39:33 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nJU5C-0001i2-Pq for pgsql-bugs@lists.postgresql.org; Mon, 14 Feb 2022 05:39:32 +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 21E5dSql2778051; Mon, 14 Feb 2022 00:39:28 -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> Comments: In-reply-to Masahiko Sawada message dated "Mon, 14 Feb 2022 14:13:27 +0900" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2778049.1644817168.1@sss.pgh.pa.us> Date: Mon, 14 Feb 2022 00:39:28 -0500 Message-ID: <2778050.1644817168@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Masahiko Sawada writes: > On Mon, Feb 14, 2022 at 6:50 AM Tom Lane wrote: >> It seems like a GUC might have an old value that we couldn't necessarily >> RESET to, without also wanting to exempt it from RESET ALL. However, >> if it isn't exempt, yet the check_hook fails, what shall we do then? >> Is throwing an error the best thing, or should we silently leave the >> variable alone? I think a lot of people would be unhappy if RESET ALL >> / DISCARD ALL had failure conditions of this sort. Should we document >> that GUCs having state-dependent restrictions on their values had >> better be marked GUC_NO_RESET_ALL? If so, can we enforce that? > Why do RESET ALL and RESET work differently with respect to resetting > one GUC in the first place? IOW why GUC_NO_RESET_ALL works only in > RESET ALL? It seems to me that RESET ALL is a command to do RESET > every single GUC, so if a GUC is exempt from RESET ALL it should be > exempt also from RESET. I toyed with that idea for awhile too, but looking through the current set of GUC_NO_RESET_ALL variables dissuaded me from it. The transaction-property GUCs need this behavior or something like it, but the rest don't. In particular, I fear that turning RESET ROLE into a no-op would create security bugs for applications that expect the current behavior. Having said that, it does seem like GUC_NO_RESET_ALL is pretty intellectually-inconsistent by definition. I'm just not sure that we can redefine our way out of that at this late date. regards, tom lane