Re: GUC names in messages
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: Peter Eisentraut <peter@eisentraut.org>
Cc: Peter Smith <smithpb2250@gmail.com>, 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: 2023-12-16T09:33:45Z
Lists: pgsql-hackers
On Thu, Dec 14, 2023 at 09:38:40AM +0100, Peter Eisentraut wrote: > After these discussions, I think this rule change was not a good idea. It > effectively enforces these kinds of inconsistencies. For example, if you > ever refactored > > "DateStyle is wrong" > > to > > "%s is wrong" > > you'd need to adjust the quotes, and thus user-visible behavior, for > entirely internal reasons. This is not good. So, what are you suggesting? Should the encouraged rule be removed from the docs? Or do you object to some of the changes done in the latest patch series v5? FWIW, I am a bit meh with v5-0001, because I don't see the benefits. On the contrary v5-0003 is useful, because it reduces a bit the number of strings to translate. That's always good to take. I don't have a problem with v5-0002, either, where we'd begin using the name of the GUC as stored in the static tables rather than the name provided in the SET query, particularly for the reason that it makes the GUC name a bit more consistent even when using double-quotes around the parameter name in the query, where the error messages would not force a lower-case conversion. The patch would, AFAIU, change HEAD from that: =# SET "intervalstylE" to popo; ERROR: 22023: invalid value for parameter "intervalstylE": "popo" To that: =# SET "intervalstylE" to popo; ERROR: 22023: invalid value for parameter "IntervalStyle": "popo" > And then came the idea to > determine the quoting dynamically, which I think everyone agreed was too > much. So I don't see a way to make this work well. Yeah, with the quotes being language-dependent, any idea I can think of is as good as unreliable and dead. -- 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