Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1x2AJC-005cZw-06 for pgsql-hackers@arkaria.postgresql.org; Thu, 03 Sep 2026 16:29:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1x2AJA-001PWG-2O for pgsql-hackers@arkaria.postgresql.org; Thu, 03 Sep 2026 16:29:00 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1x2AJA-001PW7-1Q for pgsql-hackers@lists.postgresql.org; Thu, 03 Sep 2026 16:29:00 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1x2AJ4-00000002kr5-1dLb for pgsql-hackers@lists.postgresql.org; Thu, 03 Sep 2026 16:29:00 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.18.1/8.18.1) with ESMTP id 683GSoGX1474134; Thu, 3 Sep 2026 12:28:50 -0400 From: Tom Lane To: Andrey Borodin cc: Rui Zhao , Tatsuya Kawata , fabriziomello@gmail.com, pgsql-hackers mailing list , Jobin Augustine Subject: Re: Improving display of octal GUCs In-reply-to: References: <3006313.1782851535@sss.pgh.pa.us> <767661.1783275565@sss.pgh.pa.us> Comments: In-reply-to Andrey Borodin message dated "Wed, 02 Sep 2026 18:00:04 +0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1474132.1788452930.1@sss.pgh.pa.us> Date: Thu, 03 Sep 2026 12:28:50 -0400 Message-ID: <1474133.1788452930@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Andrey Borodin writes: > I think this is worth doing because the flag is available to extensions. I > would also require a nonnegative integer range, or define signed formatting: > with the current %o, -1 is typically shown as 037777777777 on machines with > 32-bit int. All three GUCs marked GUC_SHOW_IN_OCTAL by this patch already > have a minimum of zero. I don't really feel a need to place such a restriction on the usage of the flag. %o means unsigned display everywhere, per POSIX, so there's not a portability argument for it. > Maybe the new regression test query against pg_settings could also include > setting and reset_val, as in the opening example. The former would exercise > the replacement of the old show hooks, while the latter is the only changed > auxiliary value that the test does not currently check. Those omissions are intentional, because otherwise the test would fail in "installcheck" mode on installations with non-default values for these GUCs. We could avoid that gotcha if we could locally SET the value to be displayed, but none of these GUCs permit session-level settings. I didn't think it was worth going to the trouble of, say, creating a TAP test just so we could exercise that. > With those small changes, the patch looks ready for committer. What do you think of Rui's suggestion for a HINT if we're throwing out-of-range for an octal GUC? I think it's a little more complicated than he paints it, because the syntax rules are different in postgresql.conf than in SQL, but we could make it happen if we thought it was worth the trouble. In the initial draft, I felt that showing the interpreted value in octal would be enough of a clue, but perhaps that judgment is wrong. regards, tom lane