Skip site navigation (1) Skip section navigation (2)

Re: Search content within a bytea field

From: Damiano Bolzoni <damiano(dot)bolzoni(at)gmail(dot)com>
To: Sylvain Leroux <sl20(at)wanadoo(dot)fr>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Search content within a bytea field
Date: 2009-08-31 06:06:36
Message-ID: 6fb522db0908302306n7fcda5f7ncd7423f650855dca@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-jdbc
> It seems to me that the problem is comming from the BYTEA type, not from the
> prepared statement by itself: As far as I know the only operator supported
> by BYTEA is concatenation. You can't even compare two BYTEA for (in)equality
> - even less using the LIKE operator.

Right, I suspected that too, as I've been reading a little bit around.
But...why if I manually query with a SQL client (AquaStudio) as
follows:

SELECT myfield FROM mytable WHERE myfield LIKE '%hello%'

and 'myfield' is a bytea field I get the result I expected? What's the
"trick" the client uses behind the curtains?

In response to

Responses

pgsql-jdbc by date

Next:From: Damiano BolzoniDate: 2009-08-31 06:08:43
Subject: Re: Search content within a bytea field
Previous:From: Tom LaneDate: 2009-08-30 22:58:49
Subject: Re: Search content within a bytea field

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group