1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-28 23:42:10 +03:00

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.
This commit is contained in:
Peter Eisentraut
2009-02-11 14:03:42 +00:00
parent 715ea2bf18
commit 20a43b16b4
2 changed files with 50 additions and 17 deletions

View File

@ -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