[ADMIN] ERROR: invalid byte sequence for encoding "UTF8": 0x00 - Mailing list pgsql-admin

From PropAAS DBA
Subject [ADMIN] ERROR: invalid byte sequence for encoding "UTF8": 0x00
Date
Msg-id de752e01-f36c-821e-9181-cfba78c0fbc8@propaas.com
Whole thread Raw
Responses Re: [ADMIN] ERROR: invalid byte sequence for encoding "UTF8": 0x00  (Laurenz Albe <laurenz.albe@cybertec.at>)
List pgsql-admin
All;


we are doing an oracle to Postgresql conversion, lots and lots of the 
oracle columns throw this error:


ERROR: invalid byte sequence for encoding "UTF8": 0x00

CONTEXT: converting column [colname] for foreign table scan of 
[tablename] row xxx


We are using the ora_fdw oracle foreign data wrapper extension to 
perform the data conversion, we create the foreign tables via the 
"IMPORT FOREIGN SCHEMA" option, then do an insert in [postgres_table] 
select * from [ora_fdw_table]


I've tried a number of fixes but they all seem to replace the data for 
ALL rows instead of just the broken ones.


For example:

select id, cname from ora_fdw_schema.cust_names

ERROR: invalid byte sequence for encoding "UTF8": 0x00

CONTEXT: converting column cname for foreign table scan of 
ora_fdw_schema.cust_names, row 122


If I use replace then ALL rows are NULL:

select id, replace(cname,'',NULL)  from ora_fdw_schema.cust_names
    id    |         replace

---------+----------------------

1         |

2         |

3         |

4         |

5         |

6         |

7         |




Same thing if I use translate:

select id, translate(cname,'',NULL)  from ora_fdw_schema.cust_names


Help?


Thanks in advance





-- 
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin

pgsql-admin by date:

Previous
From: chris kim
Date:
Subject: Re: [ADMIN] Standby wal issue
Next
From: Mark Kirkwood
Date:
Subject: Re: [ADMIN] Bad recovery: no pg_xlog/RECOVERYXLOG