Re: GUC names in messages
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: Peter Smith <smithpb2250@gmail.com>
Cc: Alvaro Herrera <alvherre@alvh.no-ip.org>, Peter Eisentraut <peter@eisentraut.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-11T10:00:07Z
Lists: pgsql-hackers
On Mon, Dec 11, 2023 at 10:14:11AM +1100, Peter Smith wrote:
> This v5* looks good to me, except it will need some further
> modification if PeterE's suggestion [1] to keep quotes for the
> MixedCase GUCs is adopted.
- errdetail("The database cluster was initialized with CATALOG_VERSION_NO %d,"
- " but the server was compiled with CATALOG_VERSION_NO %d.",
- ControlFile->catalog_version_no, CATALOG_VERSION_NO),
+ /*- translator: %s is a variable name and %d is its value */
+ errdetail("The database cluster was initialized with %s %d,"
+ " but the server was compiled with %s %d.",
+ "CATALOG_VERSION_NO",
Good point. There are a lot of strings that can be shaved from the
translations here.
src/backend/access/transam/xlog.c: errdetail("The database cluster was initialized with PG_CONTROL_VERSION %d (0x%08x),"
src/backend/access/transam/xlog.c: errdetail("The database cluster was initialized with PG_CONTROL_VERSION %d,"
src/backend/access/transam/xlog.c: errdetail("The database cluster was initialized without USE_FLOAT8_BYVAL"
src/backend/access/transam/xlog.c: errdetail("The database cluster was initialized with USE_FLOAT8_BYVAL"
I think that you should apply the same conversion for these ones.
There is no gain with the 1st and 3rd ones, but the 2nd and 4th one
can be grouped together.
FWIW, if we don't convert MixedCase GUCs to become mixedcase, I don't
think that there is any need to apply quotes to them because they
don't really look like natural English words. That's as far as my
opinion goes, so feel free to ignore me if the consensus is different.
--
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