So, what locale should the regression tests run in? - Mailing list pgsql-hackers

From Peter Eisentraut
Subject So, what locale should the regression tests run in?
Date
Msg-id 200901140029.40264.peter_e@gmx.net
Whole thread Raw
Responses Re: So, what locale should the regression tests run in?  (Bruce Momjian <bruce@momjian.us>)
List pgsql-hackers
While regress/GNUmakefile appears to make an effort to run the regressions
tests with or without locale depending on the users choice, .e.g.,

# locale
NOLOCALE =
ifdef NO_LOCALE
NOLOCALE += --no-locale
endif

the pg_regress.c implementation spoils that completely by unconditionally
unsetting all locale-related environment variables before initdb.  One part
of the code doesn't know what the other is doing here.

To make it work as designed in GNUmakefile, the patch below would have to
be applied.

This leaves the question, what should really be the default behavior?


diff -u -3 -p -r1.57 pg_regress.c
--- src/test/regress/pg_regress.c       8 Jan 2009 20:09:06 -0000       1.57
+++ src/test/regress/pg_regress.c       13 Jan 2009 21:53:07 -0000
@@ -689,19 +689,22 @@ initialize_environment(void)       /*        * 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)
+       {
+               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


pgsql-hackers by date:

Previous
From: Stephen Frost
Date:
Subject: Re: A single escape required for log_filename
Next
From: Andrew Dunstan
Date:
Subject: Re: A single escape required for log_filename