migration oracle to postgresql invalid byte sequen

2019-08-19 03:29发布

问题:

Im migrating an application from oracle to postgresql. In one of the functions that I already migrated I copy data from a different oracle db (db link in oracle, oracle_fdw extension in postgresql) from a few tables into a local table in my postgresql db. However, I`m getting the next error :

invalid byte sequence for encoding "UTF8": 0x00

I saw that some people had this kind of issue in this forum but they didnt try to copy the data directly from a remote database (they loaded data from a dump or from a csv..).

Some kind of idea what can I do ?

回答1:

PostgreSQL does not allow the “zero” character in character strings.

You'll have to sanitize the Oracle data before you can retrieve them from PostgreSQL.