An invalid byte sequence is encoded data that PostgreSQL cannot interpret as valid UTF-8. Migration failures commonly arise when source and target encodings differ or source data contains illegal characters. section 10.3
A migration that fails in PostgreSQL
Loading a MySQL dump containing a latin1 byte such as 0xe9, or an ASCII NUL byte 0x00, can produce an invalid-byte-sequence error. PostgreSQL strictly validates UTF-8 and rejects NUL characters in string constants, even though another database may accept them. section 10.3
Handle the failure without silently damaging the data:
- Treat unexamined conversion as a data-integrity risk: accepted bytes may later decode incorrectly and become unrecoverable. section 10.3
