Thread: Postgresql 8.1.3 Debian installation encoding question

Postgresql 8.1.3 Debian installation encoding question

From
Joost Kraaijeveld
Date:
Hi,

I was forced to reinstall PostgreSQL 8.1.3 on my Debian machine, using
the deb installation files. I used to have UTF8 or LATIN1 encoding  for
the postgres, template0 and template1 databases (can't remember which
one I actualy had :-( ).  But after my reinstallation I suddenly had
SQL_ASII as (default) encoding.

How can I change that? Why did the Debian encoding change? Can I still
use the Debian deb files or must I manually initdb PostgreSQL?

TIA

Joost





Re: Postgresql 8.1.3 Debian installation encoding question

From
Peter Eisentraut
Date:
Joost Kraaijeveld wrote:
> How can I change that? Why did the Debian encoding change?

It's derived from the locale, so make sure all your locales are set up
correctly.

> Can I
> still use the Debian deb files or must I manually initdb PostgreSQL?

These options are not exclusive.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/

Re: Postgresql 8.1.3 Debian installation encoding question

From
Joost Kraaijeveld
Date:
On Sun, 2006-03-26 at 10:20 +0200, Peter Eisentraut wrote:
> It's derived from the locale, so make sure all your locales are set up
> correctly.
OK, but how is it derived? As far as I know, I did not change anything
in the locales since the previous time I installed PostgreSQL.

My locales are:
jkr@panoramix:~$ locale
LANG=
LANGUAGE=en_US:en_GB
LC_CTYPE="POSIX"
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=


I solved the immediate "problem" by doing an "initdb -E UTF8" but I am
not quite satisfied by that sollution: it makes the installation of
PostgreSQL more difficult for non-initiated users (including myself),
who think that a simple "apt-get install'  does the right thing.

TIA

Joost

Re: Postgresql 8.1.3 Debian installation encoding question

From
Peter Eisentraut
Date:
Joost Kraaijeveld wrote:
> OK, but how is it derived? As far as I know, I did not change
> anything in the locales since the previous time I installed
> PostgreSQL.

If your locale is POSIX then it will choose SQL_ASCII.  So there is
nothing wrong in PostgreSQL, it's just that your locale is not what you
apparently need.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/

Re: Postgresql 8.1.3 Debian installation encoding question

From
"Joost Kraaijeveld"
Date:
Peter Eisentraut wrote:
> Joost Kraaijeveld wrote:
>> OK, but how is it derived? As far as I know, I did not change
>> anything in the locales since the previous time I installed
>> PostgreSQL.
>
> If your locale is POSIX then it will choose SQL_ASCII.  So there is
> nothing wrong in PostgreSQL, it's just that your locale is
> not what you apparently need.
I was certainly not implying that PostgreSQL was at fault (I wouldn't dare on a PostgreSQL mailinglist ;-) ).

But I cannot find where I have to configure what locale in the OS to get UTF8 as default encoding for the databases. (I
readhttp://www.postgresql.org/docs/8.1/static/multibyte.html but that did not give me that info). Can you tell me this
orgive me a pointer to the answer? 

TIA


Groeten,

Joost Kraaijeveld
Askesis B.V.
Molukkenstraat 14
6524NB Nijmegen
tel: 024-3888063 / 06-51855277
fax: 024-3608416
e-mail: J.Kraaijeveld@Askesis.nl
web: www.askesis.nl

Re: Postgresql 8.1.3 Debian installation encoding question

From
Peter Eisentraut
Date:
Joost Kraaijeveld wrote:
> But I cannot find where I have to configure what locale in the OS to
> get UTF8 as default encoding for the databases. (I read
> http://www.postgresql.org/docs/8.1/static/multibyte.html but that did
> not give me that info). Can you tell me this or give me a pointer to
> the answer?

You should try something like nl_NL.utf8.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/