Re: LC_MESSAGES = 'de_AT' screws restoring from dump. - Mailing list pgsql-bugs

From Tom Lane
Subject Re: LC_MESSAGES = 'de_AT' screws restoring from dump.
Date
Msg-id 2894.1086712840@sss.pgh.pa.us
Whole thread Raw
In response to LC_MESSAGES = 'de_AT' screws restoring from dump.  (Erwin Brandstetter <a9006241@unet.univie.ac.at>)
List pgsql-bugs
Erwin Brandstetter <a9006241@unet.univie.ac.at> writes:
> # While running with:
> lc_messages = 'de_AT'
> encoding = UNICODE

> psql:./e_schema.sql:157: FEHLER:  could not convert UTF-8 character
> 0x00fc to ISO8859-1
> psql:./e_schema.sql:159: FEHLER:  Relation »naehe« existiert nicht

> There seems to be something wrong with German error messages?

I suspect that de_AT on your machine implies a character set encoding
other than Unicode (likely 8859-something).  So strerror() returns
a message that is in 8859-something, but the backend assumes that all
strings inside it are in Unicode, and tries to convert based on that
assumption.  You need to use a locale setting that conforms to the
database encoding you've selected.  It might be called de_AT.utf8
or some such.

It's a real pain in the neck that Postgres can't detect locale settings
that are incompatible with the database encoding.  I don't know any
portable way to find that out, though.

            regards, tom lane

pgsql-bugs by date:

Previous
From: Erwin Brandstetter
Date:
Subject: LC_MESSAGES = 'de_AT' screws restoring from dump.
Next
From: Alvaro Herrera
Date:
Subject: Re: BUG #1161: User permissions are kept, even if user is