aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNoah Misch <noah@leadboat.com>2015-01-16 01:27:31 -0500
committerNoah Misch <noah@leadboat.com>2015-01-16 01:28:40 -0500
commit1c49561762933b6d0502bd852cf4acbcbfedd66b (patch)
tree1dced24c98eee59148dcde97f5e1a3e18f0e6134 /src
parent450530fce008ff0949d39d1db88059f5475fd0cb (diff)
downloadpostgresql-1c49561762933b6d0502bd852cf4acbcbfedd66b.tar.gz
postgresql-1c49561762933b6d0502bd852cf4acbcbfedd66b.zip
Update "pg_regress --no-locale" for Darwin and Windows.
Commit 894459e59ffa5c7fee297b246c17e1f72564db1d 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.
Diffstat (limited to 'src')
-rw-r--r--src/test/regress/pg_regress.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/test/regress/pg_regress.c b/src/test/regress/pg_regress.c
index c1bef1b5a1d..7901e46fd47 100644
--- a/src/test/regress/pg_regress.c
+++ b/src/test/regress/pg_regress.c
@@ -798,9 +798,17 @@ initialize_environment(void)
unsetenv("LC_NUMERIC");
unsetenv("LC_TIME");
unsetenv("LANG");
- /* On Windows the default locale cannot be English, so force it */
-#if defined(WIN32) || defined(__CYGWIN__)
- putenv("LANG=en");
+
+ /*
+ * Most platforms have adopted the POSIX locale as their
+ * implementation-defined default locale. Exceptions include native
+ * Windows, Darwin with --enable-nls, and Cygwin with --enable-nls.
+ * (Use of --enable-nls matters because libintl replaces setlocale().)
+ * Also, PostgreSQL does not support Darwin with locale environment
+ * variables unset; see PostmasterMain().
+ */
+#if defined(WIN32) || defined(__CYGWIN__) || defined(__darwin__)
+ putenv("LANG=C");
#endif
}