Subject: Re: GUC names in messages

From: Peter Smith <[email-masked]>
Date: Mon, 11 Dec 2023 10:14:11 +1100

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.

======
[1] https://www.postgresql.org/message-id/9e7802b2-2cf2-4c2d-b680-b2ccb9db1d2f%40eisentraut.org

Kind Regards,
Peter Smith.
Futjisu Australia.

---

From: Michael Paquier <[email-masked]>
Date: Mon, 11 Dec 2023 11:00:07 +0100

> 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