Re: GUC names in messages
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: Peter Smith <smithpb2250@gmail.com>
Cc: Peter Eisentraut <peter@eisentraut.org>, Alvaro Herrera <alvherre@alvh.no-ip.org>, Nathan Bossart <nathandbossart@gmail.com>, Laurenz Albe <laurenz.albe@cybertec.at>, Tom Lane <tgl@sss.pgh.pa.us>, Daniel Gustafsson <daniel@yesql.se>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2024-10-09T09:54:18Z
Lists: pgsql-hackers
On Tue, Oct 08, 2024 at 06:57:10PM +1100, Peter Smith wrote: > As for what is left, I had made just the minimal patch to fix the > known "IntervalStyle" problem, but that assumed prior knowledge of > what were the only problem names in the first place. Your way is > better -- to always use the record name where possible. Yes, useful for custom GUCs, even if I doubt that many of them mix character casing these days. > One thing I thought remains not so good is how > set_config_with_handle(name...) function does > record=find_option(name,...) but then all subsequent names are > supposed to be coming from the record->name. It feels confusing to > have that parameter 'name' still in scope after the find(), e.g., when > you should not be using that anymore. So, I tried to separate this > logic into 2 functions -- set_config_with_handle() and > set_config_with_handle_guts(). There are no name overlaps now, but I > wonder if the fix was overkill. See v14. I was also looking at reducing the scope of the "name" variable in this path, but that makes IMO the code a bit more confusing with the existing wrapper set_config_option() and set_config_option_ext(), while the handle is only used within fmgrs. Applied the previous patch after looking at it again. -- Michael
Commits
-
Apply GUC name from central table in more places of guc.c
- f3f06b13308e 18.0 landed
-
Use camel case for "DateStyle" in some error messages
- 2e7c4abe5a88 18.0 landed
-
Unify some error messages to ease work of translators
- a68159ff2b32 18.0 landed
-
Apply more quoting to GUC names in messages
- b4db64270e0c 18.0 landed
-
Revise GUC names quoting in messages again
- 17974ec25946 17.0 landed
-
doc: Mention how to use quotes with GUC names in error messages
- a243569bf65c 17.0 landed
-
Apply quotes more consistently to GUC names in logs
- 8d9978a7176a 17.0 landed