I am migrating an application from postgres 7.4 to postgres 9.2. The query which worked fine for inserting bytea type attribure values in postgres 7.4 is throwing PSQLException with the below error in postgres 9.2.
ERROR: syntax error at or near "\" LINE 1: ...07\000\000\001\002\000\000|\012\000\000\'\007\000...(Error is shown near the single quote)
*** Error ***
ERROR: syntax error at or near "\" SQL state: 42601 Character: 39081
I have read the postgres documentation about bytea_output which can be set to 'escape' to output the content of the attribute in escape format. It is also mentioned that bytea type attributes can accept both escape and hex format.
As the application was previously using postgres 7.4, we are using escape format. I wonder why this error is thrown if bytea can accept both escape and hex format in postgres 9.2. Please help in resolving this error.