I am implementing mysql_fdw in PostgreSQL (9.4.4). I have created foreign table and they are working fine except for one thing: For some of the rows in column idvisitor with datatype bytea, it is throwing the following error
ERROR: invalid input syntax for type bytea ********** Error **********
ERROR: invalid input syntax for type bytea SQL state: 22P02
Example: A table visits with two columns: id SERIAL, idvisitor bytea Thousand rows with id from 1 to 1000
- SELECT * FROM visits; #ERROR
- SELECT * FROM visits WHERE id BETWEEN 1 and 900; # NO ERROR
- SELECT * FROM visits WHERE id = 901; #ERROR
- SELECT * FROM visits WHERE id BETWEEN 902 AND 1000; # NO ERROR
- SELECT id FROM visits WHERE id=901; # NO ERROR
Proceeding like this, I could identify rows which are triggering the error. If I execute the same query in MySQL, it executes silently without throwing any error.