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 <[email protected]> Author: Tom Lane <[email protected]> Reviewed-by: FabrÃzio de Royes Mello <[email protected]> Reviewed-by: Tatsuya Kawata <[email protected]> Reviewed-by: Rui Zhao <[email protected]> Reviewed-by: Andrey Borodin <[email protected]> Discussion: https://postgr.es/m/[email protected] 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(-)
