Skip to content

Commit 082764a

Browse files
committed
Update "pg_regress --no-locale" for Darwin and Windows.
Commit 894459e revealed this option to be broken for NLS builds on Darwin, but "make -C contrib/unaccent check" and the buildfarm client rely on it. Fix that configuration by redefining the option to imply LANG=C on Darwin. In passing, use LANG=C instead of LANG=en on Windows; since only postmaster startup uses that value, testers are unlikely to notice the change. Back-patch to 9.0, like the predecessor commit.
1 parent 5308e08 commit 082764a

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

src/test/regress/pg_regress.c

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -793,9 +793,17 @@ initialize_environment(void)
793793
unsetenv("LC_NUMERIC");
794794
unsetenv("LC_TIME");
795795
unsetenv("LANG");
796-
/* On Windows the default locale cannot be English, so force it */
797-
#if defined(WIN32) || defined(__CYGWIN__)
798-
putenv("LANG=en");
796+
797+
/*
798+
* Most platforms have adopted the POSIX locale as their
799+
* implementation-defined default locale. Exceptions include native
800+
* Windows, Darwin with --enable-nls, and Cygwin with --enable-nls.
801+
* (Use of --enable-nls matters because libintl replaces setlocale().)
802+
* Also, PostgreSQL does not support Darwin with locale environment
803+
* variables unset; see PostmasterMain().
804+
*/
805+
#if defined(WIN32) || defined(__CYGWIN__) || defined(__darwin__)
806+
putenv("LANG=C");
799807
#endif
800808
}
801809

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy