Skip to content

Commit 5596432

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 0acb32e commit 5596432

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
@@ -789,9 +789,17 @@ initialize_environment(void)
789789
unsetenv("LC_NUMERIC");
790790
unsetenv("LC_TIME");
791791
unsetenv("LANG");
792-
/* On Windows the default locale cannot be English, so force it */
793-
#if defined(WIN32) || defined(__CYGWIN__)
794-
putenv("LANG=en");
792+
793+
/*
794+
* Most platforms have adopted the POSIX locale as their
795+
* implementation-defined default locale. Exceptions include native
796+
* Windows, Darwin with --enable-nls, and Cygwin with --enable-nls.
797+
* (Use of --enable-nls matters because libintl replaces setlocale().)
798+
* Also, PostgreSQL does not support Darwin with locale environment
799+
* variables unset; see PostmasterMain().
800+
*/
801+
#if defined(WIN32) || defined(__CYGWIN__) || defined(__darwin__)
802+
putenv("LANG=C");
795803
#endif
796804
}
797805

0 commit comments

Comments
 (0)