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

From Laurenz Albe
Subject Re: PostgreSQL JDBC Driver ERROR: invalid byte sequence for encoding "UTF8": 0x00 on Select stmt
Date
Msg-id cf4966960fa6b5511535d5bc6ff4bf6c405b6d4e.camel@cybertec.at
Whole thread Raw
In response to PostgreSQL JDBC Driver ERROR: invalid byte sequence for encoding "UTF8": 0x00 on Select stmt  (Hotmail <crajac66@hotmail.com>)
List pgsql-admin
On Sat, 2020-08-08 at 03:59 -0600, Hotmail wrote:
> 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?)

oracle_fdw will complain about zero bytes, so odds are that your PostgreSQL database is fine.
This is confirmed by the face that "SELECT * FROM atable" works in PostgreSQL.

I can see two options:

1. The statement that causes the errors is actually a different statement, for
   example an INSERT.

2. 'foo' and 'foo2' contain zero bytes.

Yours,
Laurenz Albe




pgsql-admin by date:

Previous
From: Rui DeSousa
Date:
Subject: Re: Recovery from WAL archives not advancing timeline?
Next
From: Tom Lane
Date:
Subject: Re: Postgresql background writer and checkpointer memory utilization in Linux server