Re: Locale + encoding combinations - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Locale + encoding combinations
Date
Msg-id 16980.1192029358@sss.pgh.pa.us
Whole thread Raw
In response to Re: Locale + encoding combinations  (Dave Page <dpage@postgresql.org>)
Responses Re: Locale + encoding combinations
List pgsql-hackers
Dave Page <dpage@postgresql.org> writes:
> ... There is another issue
> though as I mentioned in the post above - that it complains about an
> invalid encoding specifier on the encoding name, then ignores it and
> uses the default which seems wrong to me.

Yeah, if you look at chklocale() in initdb.c this is clearly how it
works, but there's a comment/* should we exit here? */
so whoever wrote it wasn't all that convinced it was the right behavior.

Given that 8.3 is raising the stakes for having a correct locale
specification at initdb time, it seems right to me to error out if a
bogus locale switch is given, rather than whining and then substituting
the environment default.  Any objections?

That still leaves us with the problem of how to tell whether a locale
spec is bad on Windows.  Judging by your example, Windows checks whether
the code page is present but not whether it is sane for the base locale.
What happens when there's a mismatch --- eg, what encoding do system
messages come out in?
        regards, tom lane


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Timezone database changes
Next
From: Tom Lane
Date:
Subject: Re: Skytools committed without hackers discussion/review