createdb - problem with encodings

From: Bartłomiej Romański <bartlomiej(dot)romanski(at)gmail(dot)com>
To: pgsql-admin(at)postgresql(dot)org
Subject: createdb - problem with encodings
Date: 2009-08-17 18:32:15
Message-ID: dda42a2e0908171132x3bff71daqa29fba9088452b5a@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Hi all,

I've got a strange problem with creating a new database:

br(at)ovh1:~$ createdb -E utf8 test
createdb: database creation failed: ERROR: encoding UTF8 does not
match server's locale en_US.utf8
DETAIL: The server's LC_CTYPE setting requires encoding LATIN1.

I've got some databases with UTF8 encoding and I have no idea why I
cannot create a new one now...

br(at)ovh1:~$ psql -l
List of databases
Name | Owner | Encoding
-------------+----------+----------
xxxxxxxx | br | UTF8
xxxxxxxxxx | br | UTF8
xxxxxxxxxx | br | UTF8
postgres | postgres | UTF8
template0 | postgres | UTF8
template1 | postgres | UTF8
(6 rows)

When I connect to any of them I can check my LC_CTYPE and my LC_COLLATE:

postgres=# show lc_ctype ;
lc_ctype
------------
en_US.utf8
(1 row)

postgres=# show lc_collate ;
lc_collate
------------
en_US.utf8
(1 row)

I can create a database with LATIN1 encoding. Why I cannot create a
new one with UTF8? Do you have any ideas?

I've read that doing initdb with correct locale may help. But what
should be the correct locale if not en_US.utf8??

Thank for any help,
Bartek

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Alvaro Herrera 2009-08-17 20:51:31 Re: createdb - problem with encodings
Previous Message OldManRiver 2009-08-17 15:26:26 Re: Just Forgot