Dismiss
Announcing Stack Overflow Documentation

We started with Q&A. Technical documentation is next, and we need your help.

Whether you're a beginner or an experienced developer, you can contribute.

Sign up and start helping → Learn more about Documentation →

my origin database is with SQL_ASCII encoding and my future database is with UTF8, wich is in another server.

well... I export with this command:

pg_dump -v -E UTF8 -Fc -h x.x.x.x old-database-name -U username > backup.dmp

and try import with this one

pg_restore --single-transaction -v -Fc -d new-database-name -U username <  backup.dmp

but i facing with this error:

pg_restore: [arquivador (bd)] Erro ao PROCESSAR TOC: pg_restore: [arquivador (bd)] Erro no registro do TOC 722; 1255 4594720 FUNCTION Whatever(character varying) username pg_restore: [arquivador (bd)] could not execute query: ERRO: sequência de bytes é inválida para codificação "UTF8": 0xe1 0x72 0x69

if i dumping and restore without -E parameter works well, but my new database is with characteres problems

share|improve this question

well... i had to dump like plain text and removed invalids characters with this command on linux:

iconv -c -f UTF-8 -t UTF-8 <backup.sql >backup-cleaned.sql
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.