Обсуждение: initdb: FATAL: conversion between LATIN2 and UNICODE

Поиск
Список
Период
Сортировка

initdb: FATAL: conversion between LATIN2 and UNICODE

От
Ludek Finstrle
Дата:
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.

Re: initdb: FATAL: conversion between LATIN2 and UNICODE

От
Tom Lane
Дата:
Ludek Finstrle <ludek.finstrle@pzkagis.cz> writes:
> 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

Re: initdb: FATAL: conversion between LATIN2 and UNICODE

От
Ludek Finstrle
Дата:
> 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.

> 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