Re: So, what locale should the regression tests run in?

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: So, what locale should the regression tests run in?
Date: 2009-02-06 17:25:53
Message-ID: 200902061725.n16HPrI01096@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Peter Eisentraut wrote:
> 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?

Has this been resolved?

---------------------------------------------------------------------------

>
>
> 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
>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2009-02-06 17:30:33 Re: autovacuum and reloptions
Previous Message Bruce Momjian 2009-02-06 17:24:11 Re: per-database locale: createdb switches