0

my origin database is with SQL_ASCII encoding and my future database is with UTF8, which 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 am facing 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 dump and restore without -E parameter works well, but my new database then has characters problems.

1 Answer 1

1

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
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.