pgsql: Fix yet another portability problem in new NLS test.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix yet another portability problem in new NLS test.
Date: 2026-07-17 22:08:32
Message-ID: E1wkqjP-000gV0-11@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix yet another portability problem in new NLS test.

Álvaro reported offlist that his machine was passing the new-in-v19
nls.sql test in "make check" but not in "make installcheck". On
investigation, the cause turned out to be that he has LANGUAGE set in
his environment, and with (at least recent versions of) glibc that
overrides LC_MESSAGES and friends, as per previous research by Bryan
Green. "make check" works because pg_regress unsets LANGUAGE before
starting the postmaster, but in installcheck mode we're exposed to
the prevailing value and we lose.

We're already hacking the value of LANGUAGE in this test for Solaris,
so let's just extend that to unsetting LANGUAGE on every other platform.

Reported-by: Álvaro Herrera <alvherre(at)kurilemu(dot)de>
Diagnosed-by: Andrew Dunstan <andrew(at)dunslane(dot)net>
Author: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Discussion: https://postgr.es/m/a337896e-5bff-490b-afc9-c545f06c014c@gmail.com
Backpatch-through: 19

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/f5dfd52553d3b041e30e9b1f1c6eb9f7af55fbdb

Modified Files
--------------
src/test/regress/regress.c | 6 ++++++
1 file changed, 6 insertions(+)

Browse pgsql-committers by date

  From Date Subject
Next Message Jeff Davis 2026-07-17 23:43:12 pgsql: Generate unicode_limits.h.
Previous Message Melanie Plageman 2026-07-17 20:50:22 pgsql: Turn visibilitymap_clear() Assert back into an error