Discussion:
initdb: FATAL: conversion between LATIN2 and UNICODE
(too old to reply)
Ludek Finstrle
2004-05-05 11:27:07 UTC
Permalink
Hello.

I compile pgsql 7.4.2 on Redhat 7.2 on dual AMD (32-bit arch) with:

./configure --prefix=/opt/software/postgresql/7.4.2 \
--enable-thread-safety --enable-integer-datetimes --enable-nls \
--with-pgport=5433 --with-perl --with-pam --with-openssl=/usr
make -j3

(I install bison-1875 before I configure pgsql)
Then I run initdb as pgsql user and I get error:

bash-2.05$ /opt/software/postgresql/7.4.2/bin/initdb -D /data.sql/pgsql/7.4.X/standard -E UNICODE
The files belonging to this database system will be owned by user "pgsql".
This user must also own the server process.

The database cluster will be initialized with locale cs_CZ.utf8.

fixing permissions on existing directory /data.sql/pgsql/7.4.X/standard... ok
creating directory /data.sql/pgsql/7.4.X/standard/base... ok
creating directory /data.sql/pgsql/7.4.X/standard/global... ok
creating directory /data.sql/pgsql/7.4.X/standard/pg_xlog... ok
creating directory /data.sql/pgsql/7.4.X/standard/pg_clog... ok
selecting default max_connections... 100
selecting default shared_buffers... 1000
creating configuration files... ok
creating template1 database in /data.sql/pgsql/7.4.X/standard/base/1... ok
initializing pg_shadow... FATAL: conversion between LATIN2 and UNICODE is not supported

initdb: failed
bash-2.05$

I install pgsql on this machine since 7.1 and I never had same error.
I have 7.4.1 installed without problem. Maybe I make some trivial
mistake but I can't find it.

Do you have some idea?

Luf

P.S. make check - successfuly passed all test.

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster
Tom Lane
2004-05-05 15:40:49 UTC
Permalink
Post by Ludek Finstrle
bash-2.05$ /opt/software/postgresql/7.4.2/bin/initdb -D /data.sql/pgsql/7.4.X/standard -E UNICODE
...
creating template1 database in /data.sql/pgsql/7.4.X/standard/base/1... ok
initializing pg_shadow... FATAL: conversion between LATIN2 and UNICODE is not supported
Hm, it would seem that for some reason CLIENT_ENCODING is getting set to
LATIN2. Digging in the code, the only reason I can find for that to
happen within initdb is if you have set PGCLIENTENCODING as an
environment variable in your shell.

If you want to use LATIN2 as your client encoding, it'd probably be a
good idea not to use UNICODE as the database encoding ...

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html
Ludek Finstrle
2004-05-06 07:52:03 UTC
Permalink
Post by Tom Lane
Hm, it would seem that for some reason CLIENT_ENCODING is getting set to
LATIN2. Digging in the code, the only reason I can find for that to
happen within initdb is if you have set PGCLIENTENCODING as an
environment variable in your shell.
Yes, you're right. Thank you very much.
Post by Tom Lane
If you want to use LATIN2 as your client encoding, it'd probably be a
good idea not to use UNICODE as the database encoding ...
LATIN2 encoding is only on server (RH 7.2 now, Fedora in few months).
But there is WIN1250 encoding on most clients. Is UNICODE such
speed down? I think (but I'm not sure) it's better to choose UNICODE
and have less problems in the future.

Luf

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Loading...