Re: GUC names in messages
Peter Smith <smithpb2250@gmail.com>
From: Peter Smith <smithpb2250@gmail.com>
To: Nathan Bossart <nathandbossart@gmail.com>
Cc: Alvaro Herrera <alvherre@alvh.no-ip.org>,
Laurenz Albe <laurenz.albe@cybertec.at>, Peter Eisentraut <peter@eisentraut.org>, Tom Lane <tgl@sss.pgh.pa.us>, Daniel Gustafsson <daniel@yesql.se>,
PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2023-11-08T22:53:55Z
Lists: pgsql-hackers
Attachments
- 20231107-guc-names-in-messages-data.txt (text/plain)
On Wed, Nov 8, 2023 at 7:40 AM Peter Smith <smithpb2250@gmail.com> wrote: > > FWIW, I am halfway through doing regex checking of the PG16 source for > all GUC names in messages to see what current styles are in use today. > > Not sure if those numbers will influence the decision. > > I hope I can post my findings today or tomorrow. > Here are my findings from the current PG16 source messages. I used a regex search: ".*GUCNAME to find how each GUCNAME is used in the messages in *.c files. The GUC names are taken from the guc_tables.c code, so they are grouped accordingly below. ~TOTALS: messages where GUC names are QUOTED: - bool = 11 - int = 11 - real = 0 - string = 10 - enum = 7 TOTAL = 39 messages where GUC names are NOT QUOTED: - bool = 14 - int = 60 - real = 0 - string = 59 - enum = 31 TOTAL = 164 ~~~ Details are in the attached file. PSA. I've categorised them as being currently QUOTED, NOT QUOTED, and NONE (most are not used in any messages). Notice that NOT QUOTED is the far more common pattern, so my vote would be just to standardise on making everything this way. I know there was some concern raised about ambiguous words like "timezone" and "datestyle" etc but in practice, those are rare. Also, those GUCs are different in that they are written as camel-case (e.g. "DateStyle") in the guc_tables.c, so if they were also written camel-case in the messages that could remove ambiguities with normal words. YMMV. Anyway, I will await a verdict about what to do. ====== Kind Regards, Peter Smith. Fujitsu Australia
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