Re: GUC names in messages

Daniel Gustafsson <daniel@yesql.se>

From: Daniel Gustafsson <daniel@yesql.se>
To: Peter Smith <smithpb2250@gmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2023-11-01T09:23:22Z
Lists: pgsql-hackers
> On 1 Nov 2023, at 10:02, Peter Smith <smithpb2250@gmail.com> wrote:

> GUC_check_errdetail("effective_io_concurrency must be set to 0 on
> platforms that lack posix_fadvise().");
> src/backend/commands/variable.c:
> GUC_check_errdetail("maintenance_io_concurrency must be set to 0 on
> platforms that lack posix_fadvise().");

These should be substituted to reduce the number of distinct messages that need
to be translated.  I wouldn't be surprised if more like these have slipped
through.

> I had intended to make a patch to address the inconsistency, but
> couldn't decide which of those styles was the preferred one.

Given the variety in the codebase I don't think there is a preferred one.

> Then I worried this could be the tip of the iceberg

All good rabbit-holes uncovered during hacking are.. =)

> Ideally, they should all look the same everywhere, shouldn't they?

Having a policy would be good, having one which is known and enforced is even
better (like how we are consistent around error messages based on our Error
Message Style Guide).

--
Daniel Gustafsson




Commits

  1. Apply GUC name from central table in more places of guc.c

  2. Use camel case for "DateStyle" in some error messages

  3. Unify some error messages to ease work of translators

  4. Apply more quoting to GUC names in messages

  5. Revise GUC names quoting in messages again

  6. doc: Mention how to use quotes with GUC names in error messages

  7. Apply quotes more consistently to GUC names in logs