"Peter Darley" <pdarley@kinesis-cem.com> writes:
> I'm having some trouble restoring data that was dumped from my database.
> When I dump out a table (pg_dump -d neo -t question > question.tbl) and try
> to restore it (psql -d temp -f question.tbl) I get errors on certain rows:
> "psql:question.tbl:15861: ERROR: invalid byte sequence for encoding
> "UNICODE": 0xe96520". This happens when I use SQL_ASCII or UNICODE as the
> encoding. I didn't try any other encodings.
Er, what is the encoding of the source database, exactly? Is it the
same as the encoding of the destination database?
SQL_ASCII disables all encoding checks, so it's entirely plausible that
you would have byte sequences that are not legal Unicode in a SQL_ASCII
database. If so, there's not much to do except manually clean up the
bogus data.
Also, if you're trying to restore into PG 8.1 from an older version,
we've fixed some mistakes in the Unicode encoding checker, so there
actually are differences in what the code will accept :-(
regards, tom lane