Re: Let's add a test for NLS translation of PRI* macros

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Bryan Green <dbryan.green@gmail.com>
Cc: pgsql-hackers@lists.postgresql.org
Date: 2025-12-09T17:08:28Z
Lists: pgsql-hackers

Attachments

I wrote:
> v4-0001 attached tries to deal with #1 by extracting a codeset
> name from pg_database.datctype. That seems to work for me locally,
> but I'll be interested to see what cfbot thinks.

cfbot didn't like that :-(.  Upon further review, it seems that
the locale name needs to include a valid encoding spec, but that
encoding spec doesn't actually have to match the database encoding
(checked here on Linux, macOS, all three major BSDen).  Perhaps
there would be some issues with character set conversion if not,
but the test case I'm proposing is intentionally chosen to not
involve any non-ASCII characters, so it shouldn't matter.

Hence, new version attached that just hard-codes es_ES.UTF-8.
We'll see if cfbot agrees with my local testing.

(I went ahead and pushed 0002, since that seemed pretty
uncontroversial as well as fixing a demonstrated bug.)

			regards, tom lane

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Add a regression test to verify that NLS translation works.

  2. Support "j" length modifier in snprintf.c.