Unset language-related locale settings in any case, otherwise psql will
authorPeter Eisentraut <[email protected]>
Thu, 12 Feb 2009 13:26:03 +0000 (13:26 +0000)
committerPeter Eisentraut <[email protected]>
Thu, 12 Feb 2009 13:26:03 +0000 (13:26 +0000)
speak in tongues and mess up the regression test diffs.

doc/src/sgml/regress.sgml
src/test/regress/pg_regress.c

index 3ca4cfa8e2650c1cb758b124033e9e9c4bea5fe9..833a08c44ebc3d1420b938814ea265e6dc1b1dcf 100644 (file)
@@ -218,11 +218,15 @@ gmake installcheck
      locale-related environment variables on
      the <command>make</command> command line, for example:
 <programlisting>
-gmake check LC_ALL=de_DE.utf8
+gmake check LANG=de_DE.utf8
 </programlisting>
-     or analogously to use no locale:
+     (The regression test driver unsets <envar>LC_ALL</envar>, so it
+     does not work to choose the locale using that variable.)  To use
+     no locale, either unset all locale-related environment variables
+     (or set them to <literal>C</literal>) or use the following
+     special invocation:
 <programlisting>
-gmake check LC_ALL=C
+gmake check NO_LOCALE=1
 </programlisting>
      When running the tests against an existing installation, the
      locale setup is determined by the existing installation.  To
index 944596509bf5fb73e8477af7ee1c5c84e264b544..1cd804aa7430ad8246ccb5f4c3cf8bb12d070f59 100644 (file)
@@ -694,18 +694,25 @@ initialize_environment(void)
                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");
 #endif
        }
 
+       /*
+        * Set translation-related settings to English; otherwise psql
+        * will produce translated messages and produce diffs.  (XXX If we
+        * ever support translation of pg_regress, this needs to be moved
+        * elsewhere, where psql is actually called.)
+        */
+       unsetenv("LANGUAGE");
+       unsetenv("LC_ALL");
+       putenv("LC_MESSAGES=C");
+
        /*
         * Set multibyte as requested
         */