PostgreSQL JDBC Driver ERROR: invalid byte sequence for encoding "UTF8": 0x00 on Select stmt - Mailing list pgsql-admin

From Hotmail
Subject PostgreSQL JDBC Driver ERROR: invalid byte sequence for encoding "UTF8": 0x00 on Select stmt
Date
Msg-id BYAPR06MB40234072A979C934FC1E5754D7460@BYAPR06MB4023.namprd06.prod.outlook.com
Whole thread Raw
Responses Re: PostgreSQL JDBC Driver ERROR: invalid byte sequence for encoding "UTF8": 0x00 on Select stmt  (Laurenz Albe <laurenz.albe@cybertec.at>)
List pgsql-admin
Hi All, 

We migrated data from Oracle to postgres using oracle_fdw without seeing any invalid byte sequence for encoding "UTF8": 0x00 errors. The data transfer from Oracle to Postgres using oracle_fdw completed successfully without any errors.

After we started our application using Postgres as the new data source we are consistently seeing "invalid byte sequence for encoding "UTF8": 0x00 errors" once or twice a minute on a basic select statement like this:

Select * from <table> where <col1>=‘foo’ and <col2>=‘foo2’;

Not all queries fail just some. We can select * from the table in question from psql without any invalid byte sequence errors (A problem with the jdbc client maybe?)


We went back to the source Oracle database and re-ran queries to try to find any invalid byte sequences and we could not find any. Again the data was copied with oracle_fdw with no errors. 

We would like to know if there are any queries we can run on the postgres table generating this error to identify the source of the invalid byte sequence errors. The query we used in the Oracle db to identify invalid byte sequences does not translate directly because it uses the instr oracle function. Here’s the oracle query:

select count(*) from <table_name> where instr(<table_cole>, unistr('\0000')) > 0;

Is there an equivalent query we could run in Postgres?

Regards,

Craig Jackson

pgsql-admin by date:

Previous
From: Don Seiler
Date:
Subject: Recovery from WAL archives not advancing timeline?
Next
From: Ian Lawrence Barwick
Date:
Subject: Re: Recovery from WAL archives not advancing timeline?