Re: UNICODE-encoded database does not accept umlaut-characters. - Mailing list pgsql-general

From Tom Lane
Subject Re: UNICODE-encoded database does not accept umlaut-characters.
Date
Msg-id 20519.1074487880@sss.pgh.pa.us
Whole thread Raw
In response to UNICODE-encoded database does not accept umlaut-characters.  (Erwin Brandstetter <Brsaz@gmzx.at>)
List pgsql-general
Erwin Brandstetter <Brsaz@gmzx.at> writes:
> Created a new 7.4 database.
> # create database foo with encoding = UNICODE;
> Then tried to restore my dump from pg 7.2 which was SQL-ASCII or Latin1
> encoded (cant tell which of the two, only got the dump of the old database
> left after upgrading postgresql.)
> Succeeded creating the objects, but no data was restored, instead
> postgresql complained about illegal UNICODE characters.

Yeah; by default PG will assume that you are sending it UNICODE data
if that's what the database encoding is.

You can arrange for conversion to occur by adding
    set client_encoding = latin1;
at the top of the dump file.

            regards, tom lane

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: massaging data from multiple timezones
Next
From: Tom Lane
Date:
Subject: Re: Data recovery!