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

Started by Ragnar Österlundover 19 years ago7 messagesgeneral
Jump to latest
#1Ragnar Österlund
ragoster@gmail.com

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

#2Martijn van Oosterhout
kleptog@svana.org
In reply to: Ragnar Österlund (#1)
Re: initdb: invalid locale name "sv_SE.ISO-8859-1"

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/

Show quoted text

From each according to his ability. To each according to his ability to litigate.

#3Ragnar
gnari@hive.is
In reply to: Ragnar Österlund (#1)
Re: initdb: invalid locale name "sv_SE.ISO-8859-1"

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

#4Ivan Sergio Borgonovo
mail@webthatworks.it
In reply to: Ragnar (#3)
Re: initdb: invalid locale name "sv_SE.ISO-8859-1"

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

#5Tom Lane
tgl@sss.pgh.pa.us
In reply to: Martijn van Oosterhout (#2)
Re: initdb: invalid locale name "sv_SE.ISO-8859-1"

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

#6Martijn van Oosterhout
kleptog@svana.org
In reply to: Tom Lane (#5)
Re: initdb: invalid locale name "sv_SE.ISO-8859-1"

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/

Show quoted text

From each according to his ability. To each according to his ability to litigate.

#7Ragnar Österlund
ragoster@gmail.com
In reply to: Martijn van Oosterhout (#6)
Re: initdb: invalid locale name "sv_SE.ISO-8859-1"

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