pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Avoid requiring Spanish locale to test NLS infrastructure.
Date: Mon, 15 Dec 2025 20:16:59 +0000
Message-ID: <E1vVF06-000xdT-1E@gemulon.postgresql.org> (raw)

Avoid requiring Spanish locale to test NLS infrastructure.

I had supposed that the majority of machines with gettext installed
would have most language locales installed, but at least in the
buildfarm it turns out less than half have es_ES installed.  So
depending on that to run the test now seems like a bad idea.  But it
turns out that gettext can be persuaded to "translate" even in the C
locale, as long as you fake out its short-circuit logic by spelling
the locale name like "C.UTF-8" or similar.  (Many thanks to Bryan
Green for correcting my misconceptions about that.)  Quick testing
suggests that that spelling is accepted by most platforms, though
again the buildfarm may show that "most" isn't "all".

Hence, remove the es_ES dependency and instead create a "C" message
catalog.  I've made the test unconditionally set lc_messages to
'C.UTF-8'.  That approach might need adjustment depending on what
the buildfarm shows, but let's keep it simple until proven wrong.

While at it, tweak the test so that we run the various ereport's
even when !ENABLE_NLS.  This is useful to verify that the macros
provided by <inttypes.h> are compatible with snprintf.c, as we
now know is worth questioning.

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

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/7db6809ced4406257a80766e4109c8be8e1ea744

Modified Files
--------------
src/test/regress/expected/nls.out   |  65 +++++----------
src/test/regress/expected/nls_1.out |  49 +++++------
src/test/regress/expected/nls_2.out |  35 --------
src/test/regress/po/C.po            | 161 ++++++++++++++++++++++++++++++++++++
src/test/regress/po/LINGUAS         |   2 +-
src/test/regress/po/es.po           | 159 -----------------------------------
src/test/regress/regress.c          |  45 +++++-----
src/test/regress/sql/nls.sql        |  35 ++------
8 files changed, 237 insertions(+), 314 deletions(-)



Message-ID: <E1vVF06-000xdT-1E@gemulon.postgresql.org>
Permalink:  ../E1vVF06-000xdT-1E@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1vVF06-000xdT-1E@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Avoid requiring Spanish locale to test NLS infrastructure.
  In-Reply-To: <E1vVF06-000xdT-1E@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox