Thread: initdb & multibyte

initdb & multibyte

From
source
Date:
When running initdb:

postgres@interno:/ > /usr/local/pgsql/bin/initdb
                                   -D /home/data -L /usr/local/pgsql/lib
-E UNICODE

We get the error:

initdb: pg_encoding failed

Perhaps you did not configure PostgreSQL for multibyte support or
the program was not successfully installed.

We are using Linux kernel 2.2.16 (suse 7)
Newly compiled & installed PostgreSQL 7.02 with multibyte support.

Are their some special libraries we need for multibyte?

muchas gracias, Alan






Re: initdb & multibyte

From
Tom Lane
Date:
source <source@celasmaya.edu.gt> writes:
> We get the error:
> initdb: pg_encoding failed

Hmm.  Someone else told me about seeing the same thing on a Linux box,
but I didn't hear what the resolution was.

initdb is not very good about giving you details about failures of
the programs it calls --- in particular, pg_encoding's stdout/stderr
is rerouted to /dev/null in the script :-(.  I'd recommend changing
the initdb script to not redirect pg_encoding's output, and then
you'll be able to see what pg_encoding is unhappy about.  Let us know...

            regards, tom lane

Re:Re: initdb & multibyte

From
source
Date:
OK, now we get:

/usr/local/pgsql/bin/pg_encoding: error in loading shared libraries:
/usr/local/pgsql/bin/pg_encoding: undefined symbol: pg_char_to_encoding
initdb: pg_encoding failed

Perhaps you did not configure PostgreSQL for multibyte support or
the program was not successfully installed.


----------
source <source@celasmaya.edu.gt> writes:
> We get the error:
> initdb: pg_encoding failed

Hmm.  Someone else told me about seeing the same thing on a Linux box,
but I didn't hear what the resolution was.

initdb is not very good about giving you details about failures of
the programs it calls --- in particular, pg_encoding's stdout/stderr
is rerouted to /dev/null in the script :-(.  I'd recommend changing
the initdb script to not redirect pg_encoding's output, and then
you'll be able to see what pg_encoding is unhappy about.  Let us know...

            regards, tom lane


Re: initdb & multibyte

From
Tom Lane
Date:
source <source@celasmaya.edu.gt> writes:
> OK, now we get:
> /usr/local/pgsql/bin/pg_encoding: error in loading shared libraries:
> /usr/local/pgsql/bin/pg_encoding: undefined symbol: pg_char_to_encoding
> initdb: pg_encoding failed

Ah.  pg_char_to_encoding() is in libpq.so, but only if you built the
system with multibyte configure option selected.  I'll bet that the
dynamic loader is finding a copy of libpq.so built without multibyte
support.  Do you have another postgres installation on the machine?
(At least some linux distros ship with postgres libraries in /usr/lib)

You probably need to use ldconfig to tell the system about the location
of the newly installed postgres shared libs, and make sure those are in
front of the old ones in the loader search path.

            regards, tom lane

Re: initdb & multibyte

From
Peter Eisentraut
Date:
source writes:

> initdb: pg_encoding failed

I'd guess that you didn't set up your shared library paths correctly, as
outlined in the installation instructions.

export LD_LIBRARY_PATH=/usr/local/pgsql/lib

--
Peter Eisentraut      peter_e@gmx.net       http://yi.org/peter-e/