From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andrey Borodin <x4mmm@yandex-team.ru>
Cc: Rui Zhao <zhaorui126@gmail.com>
Cc: Tatsuya Kawata <kawatatatsuya0913@gmail.com>
Cc: fabriziomello@gmail.com, pgsql-hackers mailing list <pgsql-hackers@lists.postgresql.org>
Cc: Jobin Augustine <jobinau@gmail.com>
Subject: Re: Improving display of octal GUCs
Date: Thu, 03 Sep 2026 12:28:50 -0400
Message-ID: <1474133.1788452930@sss.pgh.pa.us> (raw)
In-Reply-To: <AA0D66DB-D767-4162-9C88-A13954F05CF4@yandex-team.ru>
References: <3006313.1782851535@sss.pgh.pa.us>
<CAFcNs+pESmHx0qps0s8q7r6Jq2hVOTm_pyQCdAfqrDY1m=EwMg@mail.gmail.com>
<CAHza6qeP_p2xHq0BPOdP4iTKD5fx3+Dbcr52QWqjSsVp3i4LkQ@mail.gmail.com>
<767661.1783275565@sss.pgh.pa.us>
<CAHWVJhHZVBzQEijhNENpm0t1Yk0kCJ8Xso2854HOeDBZROxdVA@mail.gmail.com>
<AA0D66DB-D767-4162-9C88-A13954F05CF4@yandex-team.ru>
Andrey Borodin <x4mmm@yandex-team.ru> 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-hackers@postgresql.org
Cc: tgl@sss.pgh.pa.us, x4mmm@yandex-team.ru, zhaorui126@gmail.com, kawatatatsuya0913@gmail.com, jobinau@gmail.com
Subject: Re: Improving display of octal GUCs
In-Reply-To: <1474133.1788452930@sss.pgh.pa.us>
References: <3006313.1782851535@sss.pgh.pa.us> <CAFcNs+pESmHx0qps0s8q7r6Jq2hVOTm_pyQCdAfqrDY1m=EwMg@mail.gmail.com> <CAHza6qeP_p2xHq0BPOdP4iTKD5fx3+Dbcr52QWqjSsVp3i4LkQ@mail.gmail.com> <767661.1783275565@sss.pgh.pa.us> <CAHWVJhHZVBzQEijhNENpm0t1Yk0kCJ8Xso2854HOeDBZROxdVA@mail.gmail.com> <AA0D66DB-D767-4162-9C88-A13954F05CF4@yandex-team.ru> <1474133.1788452930@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox