Andreas <maps.on (AT) gmx (DOT) netwrites:
I've got pg 8.1.4 from the binary Windows installer.
Windows 2000 / German
Now I entered "\d" into psql on the text-console and got this:
db_test=# \d
ERRR: invalid byte sequence for encoding "UTF8": 0xfc6d6572220a
I can replicate this by using a UTF8 database and running the client
in a non-UTF8 locale. For example
$ LANG=de_DE.iso88591 psql postgres
Dies ist psql 8.2devel, das interaktive PostgreSQL-Terminal.
Geben Sie ein: \copyright Urheberrechtsinformationen
\h Hilfe SQL-Anweisungen
\? Hilfe interne Anweisungen
\g oder Semikolon, um eine Anfrage
\q um zu beenden
postgres=# \l
ERRR: invalid byte sequence for encoding "UTF8": 0xfc6d6572222c
TIP: This error can also happen if the byte sequence does not match the encoding expected by the server, which is controlled by "client_encoding".
postgres=# \d
ERRR: invalid byte sequence for encoding "UTF8": 0xfc6d6572220a
TIP: This error can also happen if the byte sequence does not match the encoding expected by the server, which is controlled by "client_encoding".
postgres=# \encoding
UTF8
postgres=#
The problem here is that psql is using gettext() to convert column
headings for its display to German, and gettext() sees its locale
as specifying IS, so that's the encoding it produces. When
that data is sent over to the server which thinks that the
client is using UTF8 encoding, because it hasn't been told any
different the server quite naturally barfs.
We've known about this and related issues with gettext for some time,
but a bulletproof solution isn't clear. For the moment all you can
do is be real careful about making your locale settings match up.
regards, tom lane
(end of broadcast)
TIP 4: Have you searched our list archives?
http://archives.postgresql.org