Skip to content

Commit c1c1886

Browse files
committed
Unset language-related locale settings in any case, otherwise psql will
speak in tongues and mess up the regression test diffs.
1 parent eee82d4 commit c1c1886

File tree

2 files changed

+19
-8
lines changed

2 files changed

+19
-8
lines changed

doc/src/sgml/regress.sgml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $PostgreSQL: pgsql/doc/src/sgml/regress.sgml,v 1.61 2009/02/11 14:03:41 petere Exp $ -->
1+
<!-- $PostgreSQL: pgsql/doc/src/sgml/regress.sgml,v 1.62 2009/02/12 13:26:03 petere Exp $ -->
22

33
<chapter id="regress">
44
<title id="regress-title">Regression Tests</title>
@@ -218,11 +218,15 @@ gmake installcheck
218218
locale-related environment variables on
219219
the <command>make</command> command line, for example:
220220
<programlisting>
221-
gmake check LC_ALL=de_DE.utf8
221+
gmake check LANG=de_DE.utf8
222222
</programlisting>
223-
or analogously to use no locale:
223+
(The regression test driver unsets <envar>LC_ALL</envar>, so it
224+
does not work to choose the locale using that variable.) To use
225+
no locale, either unset all locale-related environment variables
226+
(or set them to <literal>C</literal>) or use the following
227+
special invocation:
224228
<programlisting>
225-
gmake check LC_ALL=C
229+
gmake check NO_LOCALE=1
226230
</programlisting>
227231
When running the tests against an existing installation, the
228232
locale setup is determined by the existing installation. To

src/test/regress/pg_regress.c

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
1212
* Portions Copyright (c) 1994, Regents of the University of California
1313
*
14-
* $PostgreSQL: pgsql/src/test/regress/pg_regress.c,v 1.60 2009/02/11 14:03:42 petere Exp $
14+
* $PostgreSQL: pgsql/src/test/regress/pg_regress.c,v 1.61 2009/02/12 13:26:03 petere Exp $
1515
*
1616
*-------------------------------------------------------------------------
1717
*/
@@ -694,18 +694,25 @@ initialize_environment(void)
694694
unsetenv("LC_COLLATE");
695695
unsetenv("LC_CTYPE");
696696
unsetenv("LC_MONETARY");
697-
unsetenv("LC_MESSAGES");
698697
unsetenv("LC_NUMERIC");
699698
unsetenv("LC_TIME");
700-
unsetenv("LC_ALL");
701699
unsetenv("LANG");
702-
unsetenv("LANGUAGE");
703700
/* On Windows the default locale cannot be English, so force it */
704701
#if defined(WIN32) || defined(__CYGWIN__)
705702
putenv("LANG=en");
706703
#endif
707704
}
708705

706+
/*
707+
* Set translation-related settings to English; otherwise psql
708+
* will produce translated messages and produce diffs. (XXX If we
709+
* ever support translation of pg_regress, this needs to be moved
710+
* elsewhere, where psql is actually called.)
711+
*/
712+
unsetenv("LANGUAGE");
713+
unsetenv("LC_ALL");
714+
putenv("LC_MESSAGES=C");
715+
709716
/*
710717
* Set multibyte as requested
711718
*/

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy