Re: BUG #17385: "RESET transaction_isolation" inside serializable transaction causes Assert at the transaction end - Mailing list pgsql-bugs

From Kyotaro Horiguchi
Subject Re: BUG #17385: "RESET transaction_isolation" inside serializable transaction causes Assert at the transaction end
Date
Msg-id 20220314.173000.398225758850773114.horikyota.ntt@gmail.com
Whole thread Raw
In response to Re: BUG #17385: "RESET transaction_isolation" inside serializable transaction causes Assert at the transaction end  (Masahiko Sawada <sawada.mshk@gmail.com>)
Responses Re: BUG #17385: "RESET transaction_isolation" inside serializable transaction causes Assert at the transaction end  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
At Mon, 14 Mar 2022 17:12:18 +0900, Masahiko Sawada <sawada.mshk@gmail.com> wrote in 
> On Sat, Mar 12, 2022 at 4:53 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> >
> > Masahiko Sawada <sawada.mshk@gmail.com> writes:
> > > I've attached a draft patch for discussion.
> >
> > Hm, I think that trying to RESET a GUC_NO_RESET variable ought to
> > actively throw an error.  Silently doing nothing will look like
> > a bug.
> 
> Agreed. I've attached an updated patch.

FWIW, 

+    /* Check if the parameter supports RESET */
+    if (record->flags & GUC_NO_RESET && value == NULL)
+    {
+        ereport(elevel,
+                (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+                 errmsg("parameter \"%s\" cannot be reset",
+                        name)));

ERRCODE_FEATURE_NOT_SUPPORTED doesn't look proper for the case. Isn't
it ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE or something like?

regards.

-- 
Kyotaro Horiguchi
NTT Open Source Software Center



pgsql-bugs by date:

Previous
From: Masahiko Sawada
Date:
Subject: Re: BUG #17385: "RESET transaction_isolation" inside serializable transaction causes Assert at the transaction end
Next
From: Tom Lane
Date:
Subject: Re: BUG #17385: "RESET transaction_isolation" inside serializable transaction causes Assert at the transaction end