pgsql: Test PRI* macros even when we can't test NLS translation.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Test PRI* macros even when we can't test NLS translation.
Date: 2025-12-16 17:01:54
Message-ID: E1vVYQr-00161h-2c@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Test PRI* macros even when we can't test NLS translation.

Further research shows that the reason commit 7db6809ce failed
is that recent glibc versions short-circuit translation attempts
when LC_MESSAGES is 'C.<encoding>', not only when it's 'C'.
There seems no way around that, so we'll have to live with only
testing NLS when a suitable real locale is installed.

However, something can still be salvaged: it still seems like a
good idea to verify that the PRI* macros work as-expected even when
we can't check their translations (see f8715ec86 for motivation).
Hence, adjust the test to always run the ereport calls, and tweak
the parameter values in hopes of detecting any cases where there's
confusion about the actual widths of the parameters.

Discussion: https://postgr.es/m/1991599.1765818338@sss.pgh.pa.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/462e2476525e71aa028c4a079bd77d2cac8a36b7

Modified Files
--------------
src/test/regress/expected/nls.out | 21 ++++++++-------------
src/test/regress/expected/nls_1.out | 21 ++++++++++++++++-----
src/test/regress/expected/nls_2.out | 29 ++++++++++++++++++++++++-----
src/test/regress/regress.c | 34 +++++++++++++++++++++++-----------
src/test/regress/sql/nls.sql | 6 ------
5 files changed, 71 insertions(+), 40 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Robert Haas 2025-12-16 17:31:47 pgsql: Switch memory contexts in ReinitializeParallelDSM.
Previous Message Melanie Plageman 2025-12-16 16:05:27 pgsql: Fix const qualification in prune_freeze_setup()