Thread: initdb: invalid locale name "sv_SE.ISO-8859-1"

initdb: invalid locale name "sv_SE.ISO-8859-1"

From
"Ragnar Österlund"
Date:
Hi,

When I try to initialize a new cluster like this:

/usr/lib/postgresql/8.1/bin/initdb --locale=sv_SE.ISO-8859-1 -D sv_SE_data/

I get the error:

initdb: invalid locale name "sv_SE.ISO-8859-1"

This is on Ubuntu that it fails. It works fine on my slackware
installation. I tried compile postgresql from source on ubuntu, as I
thought it might had been the binary installation that was not
correct, but the source installation failed the same way. I have a
locale for sv in /usr/share/locales. What on earth can it be that is
wrong?

/Ragnar

Re: initdb: invalid locale name "sv_SE.ISO-8859-1"

From
Martijn van Oosterhout
Date:
On Tue, Sep 12, 2006 at 09:43:31AM +0200, Ragnar Österlund wrote:
> Hi,
>
> When I try to initialize a new cluster like this:
>
> /usr/lib/postgresql/8.1/bin/initdb --locale=sv_SE.ISO-8859-1 -D sv_SE_data/
>
> I get the error:
>
> initdb: invalid locale name "sv_SE.ISO-8859-1"

Check whether this locale exists in /etc/locale.gen. If the name
doesn't exactly match, postgresql will complain that it doesn't know
it.

Either choose a name that is in that list, or add the one you want and
follow the instructions to rebuild the locale database.

Hope this helps,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

Attachment

Re: initdb: invalid locale name "sv_SE.ISO-8859-1"

From
Ragnar
Date:
On þri, 2006-09-12 at 09:43 +0200, Ragnar Österlund wrote:

> When I try to initialize a new cluster like this:
>
> /usr/lib/postgresql/8.1/bin/initdb --locale=sv_SE.ISO-8859-1 -D sv_SE_data/
>
> I get the error:
>
> initdb: invalid locale name "sv_SE.ISO-8859-1"
>
> This is on Ubuntu that it fails. It works fine on my slackware
> installation. I tried compile postgresql from source on ubuntu,

I think that nowadays Ubuntu does only create UFT-8
locales.

try man locale-gen

gnari





Re: initdb: invalid locale name "sv_SE.ISO-8859-1"

From
Ivan Sergio Borgonovo
Date:
On Tue, 12 Sep 2006 13:20:47 +0000
Ragnar <gnari@hive.is> wrote:

> > This is on Ubuntu that it fails. It works fine on my slackware
> > installation. I tried compile postgresql from source on ubuntu,
>
> I think that nowadays Ubuntu does only create UFT-8
> locales.

> try man locale-gen

I've bad memories of how to tweak with ubuntu's locales.
Differently from Debian doing
dpkg-reconfigure -plow locales won't help
You had to do it manually.

here are the explanation on how I did it

http://www.webthatworks.it/drupal/2006/09/general/generating_new_locales_in_ubuntu_kubuntu_co

--
Ivan Sergio Borgonovo
http://www.webthatworks.it


Re: initdb: invalid locale name "sv_SE.ISO-8859-1"

From
Tom Lane
Date:
Martijn van Oosterhout <kleptog@svana.org> writes:
> On Tue, Sep 12, 2006 at 09:43:31AM +0200, Ragnar =D6sterlund wrote:
>> I get the error:
>> initdb: invalid locale name "sv_SE.ISO-8859-1"

> Check whether this locale exists in /etc/locale.gen. If the name
> doesn't exactly match, postgresql will complain that it doesn't know
> it.

I think the more portable way to discover what locale names the OS
knows is "locale -a" ... /etc/locale.gen doesn't exist on my machines.

FWIW, on the machines I have access to, "sv_SE.iso88591" seems to be the
standard spelling for this locale name; for instance on Fedora Core 5

$ locale -a | grep sv
sv_FI
sv_FI.iso88591
sv_FI.iso885915@euro
sv_FI.utf8
sv_FI@euro
sv_SE
sv_SE.iso88591
sv_SE.iso885915
sv_SE.utf8
$

            regards, tom lane

Re: initdb: invalid locale name "sv_SE.ISO-8859-1"

From
Martijn van Oosterhout
Date:
On Tue, Sep 12, 2006 at 10:05:33AM -0400, Tom Lane wrote:
> > Check whether this locale exists in /etc/locale.gen. If the name
> > doesn't exactly match, postgresql will complain that it doesn't know
> > it.
>
> I think the more portable way to discover what locale names the OS
> knows is "locale -a" ... /etc/locale.gen doesn't exist on my machines.

Debian and Ubuntu stopped shipping complete locale databases a long
time ago, it was way too large for a base system (>50MB IIRC). So
there's now a file where you list the locales you want and it creates a
database with just that.

> FWIW, on the machines I have access to, "sv_SE.iso88591" seems to be the
> standard spelling for this locale name; for instance on Fedora Core 5

locale... standard spelling... Heh, this is one area where "standard"
doesn't mean very much.

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

Attachment

Re: initdb: invalid locale name "sv_SE.ISO-8859-1"

From
"Ragnar Österlund"
Date:
Thanks for the advice, I tried to install the "language-packs" that
ubuntu supports. I can no initialize a se_SV.utf8 cluster, but it
seems there is no support form latin1.

Best whishes

/Ragnar