pgsql: Improve display of GUCs that are customarily written in octal.
pgsql: Improve display of GUCs that are customarily written in octal.
От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
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 Author: Tom Lane Reviewed-by: Fabrízio de Royes Mello Reviewed-by: Tatsuya Kawata Reviewed-by: Rui Zhao Reviewed-by: Andrey Borodin 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(-)