Search content within a bytea field - Mailing list pgsql-jdbc

From Damiano Bolzoni
Subject Search content within a bytea field
Date
Msg-id 6fb522db0908301333o3bfeb6e9l5c2ad9dd04308e18@mail.gmail.com
Whole thread Raw
Responses Re: Search content within a bytea field  (Sylvain Leroux <sl20@wanadoo.fr>)
Re: Search content within a bytea field  (dmp <danap@ttc-cmc.net>)
List pgsql-jdbc
Hi all,
I'm trying to search for some content within a bytea field. My
PreparedStatement looks like this:

SELECT id FROM mytable WHERE myfield LIKE ?

Now, when I execute a

ps.setString(1, "%" + value + "%")

where 'value' is the value I want to search for, the PS becomes

SELECT id FROM mytable WHERE myfield LIKE %VALUE%

and the query clearly fails ("operator does not exist: bytea ~~
character varying"). Now, my question is....why? What am I doing
wrong?

Thanks for you help!

pgsql-jdbc by date:

Previous
From: Brett Henderson
Date:
Subject: Re: Prepared Statement Query Planning
Next
From: Sylvain Leroux
Date:
Subject: Re: Search content within a bytea field