Unix Technical Forum

Backup and restore UTF8 data

This is a discussion on Backup and restore UTF8 data within the Pgsql General forums, part of the PostgreSQL category; --> Hi, I am trying to backup an installation (8.0.3) and restore it to a new (8.2.1) installation. I am ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > Pgsql General

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-09-2008, 01:22 PM
Benjamin Arai
 
Posts: n/a
Default Backup and restore UTF8 data

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.

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

Does anybody know what I can do to fix this?

Benjamin

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org/

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-09-2008, 01:22 PM
Devrim GUNDUZ
 
Posts: n/a
Default Re: Backup and restore UTF8 data

On Fri, 2007-01-12 at 16:02 -0800, Benjamin Arai wrote:
>
> psqlutfile: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/




-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQBFqCLzpme12CBXnxERAgVNAJ9l9pVBjlwv0E/3LXtA//CvAvjz1gCfdpdk
amxnAqVrfFJYBLltYP/wWK8=
=0HSA
-----END PGP SIGNATURE-----

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 05:26 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com