Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
dwhdeveloper
Contributor
Contributor

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

I received the following error when insert string column from mysql to Postgres.
Some of the rows were fixed when I did trim(both CHAR(0x00) from text)  in my sql. 
But I am still getting this error for some other rows. 
Maybe it has invalid characters in the middle. 
How do I get rid of them? 
Labels (2)
3 Replies
Anonymous
Not applicable

Hi,
Postgesql does not supports zero in characters. 
Could you please take a look at this post:http://stackoverflow.com/questions/1347646/postgres-error-on-insert-error-invalid-byte-sequence-for-...?
You can use tMap to replace " \\x00" in expression.
Best regards
Sabrina
vaibs_parab
Contributor II
Contributor II

I had also faced the same issue recently. As I'm working with PostgreSQL database while inserting the data from Excel (.xlsx) file.

 

The PostgreSQL does not support zero in characters or 0x00 (unlike Oracle). You have to replace such chars with space or anything else.

 

In order to do so, you have to implement an expression in tMap to handle such situations. 

Use below expression:

row1.your_column_name.replace("\\x00", " ")

For reference, follow below link:

http://stackoverflow.com/questions/1347646/postgres-error-on-insert-error-invalid-byte-sequence-for-...

 

This work for me. Give it a try.

 

Regards

raghu780
Contributor
Contributor

How can we handle the same issue in Talend data Mapper.

 

I used below function while loading the data into PostgreSQL database.

 

i've uploaded the regex and replace string.

 

Thanks,

Raghu.

 

 


Screen Shot 2019-09-10 at 11.19.39 AM.png