Re: localization problem (and solution) - Mailing list pgsql-hackers

From Andreas Seltenreich
Subject Re: localization problem (and solution)
Date
Msg-id 87wthzhqt7.fsf@gate450.dyndns.org
Whole thread Raw
In response to Re: localization problem (and solution)  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: localization problem (and solution)
List pgsql-hackers
Tom Lane writes:

> I looked into this a bit more, and it seems the issue is that libperl
> will do
>     setlocale(LC_ALL, "");
> the first time any locale-related Perl function is invoked.  To defend
> ourselves against that, we'd have to set more environment variables than
> just LC_COLLATE and LC_CTYPE.
>
> What I'm thinking about is:
> * during startup, putenv("LC_ALL=C") and unsetenv any other LC_ variables
>   that may be lurking, except LC_MESSAGES.
> * copy LC_COLLATE and LC_CTYPE into the environment when we get them
>   from pg_control, as Manuel suggested.

I'm afraid having LC_ALL in the environment at this time would still
do the wrong thing on setlocale(LC_ALL, ""); since a LC_ALL
environment variable overrides the other categories. Maybe setting
LANG instead would be a better choice?

regards,
Andreas
-- 


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: I am back online again
Next
From: Hannu Krosing
Date:
Subject: Re: status of concurrent VACUUM patch ...