Page 1 of 1

Cant create database on remote postgresql server

PostPosted: Mon Nov 22, 2010 9:59 am
by Winterdaerm
I set up a remote server but on debian 5.0 (postgresql 8.3.11 with schemas).
But when i try to create a db in PT3 i get the following error.

Unable to create PostgreSQL database: PT3_DB
Reason: Unable to execute query: CREATE DATABASE "PT3_DB" WITH TEMPLATE = template0 ENCODING = 'SQL_ASCII';; Reason: Fatal Error (ERROR: encoding SQL_ASCII does not match server's locale en_US.UTF-8 DETAIL: The server's LC_CTYPE setting requires encoding UTF8. )


I looked into the postgresql.conf but there is no lc_type to change.

Any idea as to what i should do?
When i try to run the command that is shown in the errormesasage directly in the psql command window it works, and creates a DB.

Re: Cant create database on remote postgresql server

PostPosted: Mon Nov 22, 2010 10:36 am
by kraada
It sounds like this is a Debian specific issue as they've added a patch to disallow locales that aren't installed by default (see here). However, I think (I'm not running Debian anymore so I can't check) that if you install the locales-all package and dpkg --reconfigure locales you should be able to add the ASCII (or POSIX) locale which should be sufficient to get you going.

Re: Cant create database on remote postgresql server

PostPosted: Mon Nov 22, 2010 11:53 am
by Winterdaerm
There are no ascii encodings to choose from when reconfiguring locales.
ONly country specific iso and utf sets.
Hm any other way to work around this?

Re: Cant create database on remote postgresql server

PostPosted: Mon Nov 22, 2010 3:07 pm
by kraada
POSIX isn't available? I know we plan to move to UTF-8 support eventually but I don't have a timeframe on that at this point.

I'm not having any trouble in Ubuntu setting this up, for what it's worth. Perhaps if you recompiled PostgreSQL from tarball it would work properly?