Erwin Brandstetter <Brsaz(at)gmzx(dot)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