Обсуждение: Backup and restore UTF8 data

Поиск
Список
Период
Сортировка

Backup and restore UTF8 data

От
Benjamin Arai
Дата:
Hi,

I am trying to backup an installation (8.0.3) and restore it to a new
(8.2.1) installation.  I am am running the following command the backup
the data.

pg_dumpall > outfile

Then on the new machine I am simply running:

ENCODING=UTF8 psql -f outfile postgres

I get the following error for some of the records.

psql:outfile:151275: ERROR:  invalid byte sequence for encoding "UTF8": 0x92

Does anybody know what I can do to fix this?

Benjamin

Re: Backup and restore UTF8 data

От
Devrim GUNDUZ
Дата:
On Fri, 2007-01-12 at 16:02 -0800, Benjamin Arai wrote:
>
> psql:outfile:151275: ERROR:  invalid byte sequence for encoding
> "UTF8": 0x92
>
> Does anybody know what I can do to fix this?

Here is a copy-paste from 8.1 release notes:
==================================================================
Some users are having problems loading UTF-8 data into 8.1.X. This is
because previous versions allowed invalid UTF-8 byte sequences to be
entered into the database, and this release properly accepts only valid
UTF-8 sequences. One way to correct a dumpfile is to run the command
iconv -c -f UTF-8 -t UTF-8 -o cleanfile.sql dumpfile.sql. The -c option
removes invalid character sequences. A diff of the two files will show
the sequences that are invalid. iconv reads the entire input file into
memory so it might be necessary to use split to break up the dump into
multiple smaller files for processing.
==================================================================

This is also valid for your problem.

Regards,
--
The PostgreSQL Company - Command Prompt, Inc. 1.503.667.4564
PostgreSQL Replication, Consulting, Custom Development, 24x7 support
Managed Services, Shared and Dedicated Hosting
Co-Authors: plPHP, ODBCng - http://www.commandprompt.com/




Вложения