aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Eisentraut <peter_e@gmx.net>2009-02-11 14:03:42 +0000
committerPeter Eisentraut <peter_e@gmx.net>2009-02-11 14:03:42 +0000
commit20a43b16b4e9316e1b35f18351cd81ed3b9770ec (patch)
tree80ca03e1995043e824f0fe7ffdae26179a4a52b9 /src
parent715ea2bf183770a7669aeab130e6c1bd3c433d55 (diff)
downloadpostgresql-20a43b16b4e9316e1b35f18351cd81ed3b9770ec.tar.gz
postgresql-20a43b16b4e9316e1b35f18351cd81ed3b9770ec.zip
Only unset the locale environment when --no-locale is used (the way it was
presumably designed, but didn't act). This allows running the temp install tests in a non-C locale, thus exercising users' real environments better. Document how to change locales for test runs.
Diffstat (limited to 'src')
-rw-r--r--src/test/regress/pg_regress.c33
1 files changed, 18 insertions, 15 deletions
diff --git a/src/test/regress/pg_regress.c b/src/test/regress/pg_regress.c
index 843d3c7294f..2ff76483d2e 100644
--- a/src/test/regress/pg_regress.c
+++ b/src/test/regress/pg_regress.c
@@ -11,7 +11,7 @@
* Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/test/regress/pg_regress.c,v 1.59 2009/01/28 15:32:21 mha Exp $
+ * $PostgreSQL: pgsql/src/test/regress/pg_regress.c,v 1.60 2009/02/11 14:03:42 petere Exp $
*
*-------------------------------------------------------------------------
*/
@@ -686,22 +686,25 @@ initialize_environment(void)
{
char *tmp;
- /*
- * Clear out any non-C locale settings
- */
- unsetenv("LC_COLLATE");
- unsetenv("LC_CTYPE");
- unsetenv("LC_MONETARY");
- unsetenv("LC_MESSAGES");
- unsetenv("LC_NUMERIC");
- unsetenv("LC_TIME");
- unsetenv("LC_ALL");
- unsetenv("LANG");
- unsetenv("LANGUAGE");
- /* On Windows the default locale cannot be English, so force it */
+ if (nolocale)
+ {
+ /*
+ * Clear out any non-C locale settings
+ */
+ unsetenv("LC_COLLATE");
+ unsetenv("LC_CTYPE");
+ unsetenv("LC_MONETARY");
+ unsetenv("LC_MESSAGES");
+ unsetenv("LC_NUMERIC");
+ unsetenv("LC_TIME");
+ unsetenv("LC_ALL");
+ unsetenv("LANG");
+ unsetenv("LANGUAGE");
+ /* On Windows the default locale cannot be English, so force it */
#if defined(WIN32) || defined(__CYGWIN__)
- putenv("LANG=en");
+ putenv("LANG=en");
#endif
+ }
/*
* Set multibyte as requested