Re: GUC names in messages

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Peter Smith <smithpb2250(at)gmail(dot)com>
Cc: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Peter Eisentraut <peter(at)eisentraut(dot)org>, Nathan Bossart <nathandbossart(at)gmail(dot)com>, Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Daniel Gustafsson <daniel(at)yesql(dot)se>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: GUC names in messages
Date: 2023-12-11 10:00:07
Message-ID: ZXbdpy7whLILt04A@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2023-12-11 10:19:40 Re: Make COPY format extendable: Extract COPY TO format implementations
Previous Message Michael Paquier 2023-12-11 09:44:46 Re: Adding facility for injection points (or probe points?) for more advanced tests