Re: Locale + encoding combinations

From: Dave Page <dpage(at)postgresql(dot)org>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Locale + encoding combinations
Date: 2007-10-10 12:49:57
Message-ID: 470CCA75.1070108@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Peter Eisentraut wrote:
> Am Mittwoch, 10. Oktober 2007 schrieb Dave Page:
>> my original question remains: why can I only select the
>> *default* encoding for the chosen locale, but not other ones that are
>> also be valid according to setlocale? Is this a bug, or is there some
>> technical reason?
>
> One locale works only with one encoding. There are no "default" or perhaps
> alternative encodings for one locale; there is only one. The whole point of
> the exercise is to determine what the spelling of that one encoding is in
> PostgreSQL.
>
> Perhaps you are confused about the naming. These are all entirely separate
> locales:
>
> en_GB.iso88591
> en_GB.iso885915
> en_GB.utf8
>
> Someone was friendly enough to include the name of the encoding used by the
> locale into its name, but that doesn't mean that en_GB has three alternative
> encodings or something.
>
> At least that's the model we have on POSIX platforms.

OK, sorting out my terminology deficiencies has helped - thanks. The
problem seems to be:

initdb --locale "English_United Kingdom.28591"

works, but

initdb -E LATIN1 --locale "English_United Kingdom"

does not. That's good (albeit inconsistent), I know how to fix
pgInstaller now. What isn't so good is:

============
C:\pg>bin\initdb --locale "English_United Kingdom.99999" -D data
initdb: invalid locale name "English_United Kingdom.99999"
initdb: invalid locale name "English_United Kingdom.99999"
initdb: invalid locale name "English_United Kingdom.99999"
initdb: invalid locale name "English_United Kingdom.99999"
initdb: invalid locale name "English_United Kingdom.99999"
initdb: invalid locale name "English_United Kingdom.99999"
The files belonging to this database system will be owned by user "Dave".
This user must also own the server process.

The database cluster will be initialized with locale English_United
Kingdom.1252
.
The default database encoding has accordingly been set to WIN1252.
===========

Shouldn't that have failed?

Regards, Dave

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2007-10-10 12:55:15 Re: permission denied for tablespace pg_global?
Previous Message Tom Lane 2007-10-10 12:37:48 Re: Locale + encoding combinations