Re: buildfarm / handling (undefined) locales - Mailing list pgsql-hackers

From Tom Lane
Subject Re: buildfarm / handling (undefined) locales
Date
Msg-id 17725.1400077197@sss.pgh.pa.us
Whole thread Raw
In response to Re: buildfarm / handling (undefined) locales  (Heikki Linnakangas <hlinnakangas@vmware.com>)
Responses Re: buildfarm / handling (undefined) locales  (Heikki Linnakangas <hlinnakangas@vmware.com>)
Re: buildfarm / handling (undefined) locales  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Heikki Linnakangas <hlinnakangas@vmware.com> writes:
> On 05/14/2014 12:07 AM, Tom Lane wrote:
>> Well, all we know is that we asked setlocale for the default locale from
>> the environment and it failed.  We don't really know which variable(s)
>> it looked at.

> Printing the values of the environment variables sounds complicated, but 
> I think a generic hint along these lines would be good:

> initdb: environment locale settings are invalid
> HINT: This usually means that the LANG, LC_ALL or LC_* environment 
> variable has an invalid value.

Hm.  Keep in mind this is not backend code so we don't have a HINT
formalism.  How about

initdb: invalid locale settings; check LANG and LC_* environment variables

> Specifically mentioning those environment variables by name would be 
> very helpful to the user. They are specified by POSIX: 
> http://pubs.opengroup.org/onlinepubs/7908799/xbd/envvar.html, so they're 
> not that platform-specific. Windows is a different story, though.

I seem to recall having heard that some implementations check LANGUAGE
and perhaps other spellings as well.  Still, this might be better than
assuming the user has a clue what to check.

As far as Windows goes, we could certainly use #ifdef WIN32 to print
some different text, if anyone can write down what it should be.

Anyway, given that we seem to have consensus on doing this (modulo
exact text of the error message), the next question is whether we
want to change this only in HEAD, or consider it a back-patchable
bug fix.  I lean to the former but can see that there's some
argument for the latter.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Zhe-Wei Jiang
Date:
Subject: Re: Wanna help PostgreSQL
Next
From: Andrew Dunstan
Date:
Subject: Re: popen and pclose redefinitions causing many warning in Windows build