agora inbox for pgsql-committers@postgresql.org  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Improve display of GUCs that are customarily written in octal.
Date: Mon, 07 Sep 2026 20:05:28 +0000
Message-ID: <E1x3fap-00000003tDW-14lE@gemulon.postgresql.org> (raw)

Improve display of GUCs that are customarily written in octal.

A few integer-valued GUCs representing Unix file permission masks
are customarily written and shown in octal.  However, we implemented
the "shown" part via show_hook functions, which is problematic
because it only affects display of the current value.  It's confusing
that, for example, the pg_settings view renders the current value in
octal but the min, max, reset, and boot values in decimal.

To improve matters, get rid of these custom show_hooks in favor of
inventing a per-GUC flag GUC_SHOW_IN_OCTAL, which can be inspected in
appropriate places.  I've implemented that in places that respond to
units flags, but not in places that don't, such as GetConfigOption().

It's tempting to consider going further, in particular adjusting
input parsing so that we read the values of these variables in
octal even without a leading zero.  I've refrained from doing so
here because I'm afraid that it'd break more usages than it fixes,
but perhaps there's a case to be made for that.

Bug: #19540
Reported-by: Jobin Augustine <jobinau@gmail.com>
Author: Tom Lane <tgl@sss.pgh.pa.us>
Reviewed-by: Fabrízio de Royes Mello <fabriziomello@gmail.com>
Reviewed-by: Tatsuya Kawata <kawatatatsuya0913@gmail.com>
Reviewed-by: Rui Zhao <zhaorui126@gmail.com>
Reviewed-by: Andrey Borodin <x4mmm@yandex-team.ru>
Discussion: https://postgr.es/m/3006313.1782851535@sss.pgh.pa.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/23c07b4604387b98efd25246b185b57be237d7ca

Modified Files
--------------
src/backend/commands/variable.c           | 40 -----------------------
src/backend/utils/misc/README             |  6 ++++
src/backend/utils/misc/guc.c              | 53 +++++++++++++++++++++++--------
src/backend/utils/misc/guc_funcs.c        | 15 ++++++---
src/backend/utils/misc/guc_parameters.dat |  7 ++--
src/include/utils/guc.h                   |  1 +
src/include/utils/guc_hooks.h             |  3 --
src/test/regress/expected/guc.out         | 14 ++++++++
src/test/regress/sql/guc.sql              |  7 ++++
9 files changed, 82 insertions(+), 64 deletions(-)



Message-ID: <E1x3fap-00000003tDW-14lE@gemulon.postgresql.org>
Permalink:  ../E1x3fap-00000003tDW-14lE@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1x3fap-00000003tDW-14lE@gemulon.postgresql.org

reply

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 using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Improve display of GUCs that are customarily written in octal.
  In-Reply-To: <E1x3fap-00000003tDW-14lE@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox