0

I am trying to insert data from Oracle Database to PostgreSQL. In Oracle Database, It was success with standard statement:

insert into "schema"."table"@dblink values (2, 'test');

But when I added special character like '²' next to 'test', it returned the error:

insert into "schema"."table"@dblink values (2, 'test²'); ORA-28500: connection from ORACLE to a non-Oracle system returned this message: ERROR: invalid byte sequence for encoding "UTF8": 0xbf; Error while executing the query {22021,NativeErr = 7} ORA-02063: preceding 3 lines from dblink

I guess this was related to language "UTF8" compatibility but I have no clue where to fix it. I hope my question is clear - sorry for improper language.

Jonathan
  • 6,507
  • 5
  • 37
  • 47

1 Answers1

0

0xbf is ISO-8859-1 ¿, and in various other ISO-8859 encodings it's ż, ŋ, П, ؟, Ώ, , æ, . I don't know what encoding your Oracle system is using or what encoding it's sending data to PostgreSQL in, but it looks like Oracle is sending PostgreSQL data in some encoding other than UTF-8, but telling PostgreSQL it's UTF-8 encoded.

Try setting client_encoding in your PostgreSQL connection string to the encoding of your Oracle database. Or set the encoding via your ODBC configuration or however you set up your Oracle-to-postgres connection.

Craig Ringer
  • 307,061
  • 76
  • 688
  • 778