Re: Search content within a bytea field

Поиск
Список
Период
Сортировка
Искать
От
Tom Lane
Тема
Re: Search content within a bytea field
Дата
Msg-id
4017.1251673129@sss.pgh.pa.us
Ответ на
Список
Дерево обсуждения
Search content within a bytea field Damiano Bolzoni <damiano.bolzoni@gmail.com>
Re: Search content within a bytea field Sylvain Leroux <sl20@wanadoo.fr>
Re: Search content within a bytea field Tom Lane <tgl@sss.pgh.pa.us>
Re: Search content within a bytea field Sylvain Leroux <sl20@wanadoo.fr>
Re: Search content within a bytea field Damiano Bolzoni <damiano.bolzoni@gmail.com>
Re: Search content within a bytea field Damiano Bolzoni <damiano.bolzoni@gmail.com>
Re: Search content within a bytea field Tom Lane <tgl@sss.pgh.pa.us>
Re: Search content within a bytea field Florian Weimer <fweimer@bfk.de>
Re: Search content within a bytea field Kris Jurka <books@ejurka.com>
Re: Search content within a bytea field Florian Weimer <fweimer@bfk.de>
Re: Search content within a bytea field Kris Jurka <books@ejurka.com>
Re: Search content within a bytea field Thomas Kellerer <spam_eater@gmx.net>
Re: Search content within a bytea field dmp <danap@ttc-cmc.net>
Sylvain Leroux  writes:
> 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.

Nonsense ...

regression=# select oid::regoperator from pg_operator where oprleft = 'bytea'::regtype or oprright = 'bytea'::regtype;
       oid        
------------------
 =(bytea,bytea)
 <>(bytea,bytea)
 <(bytea,bytea)
 <=(bytea,bytea)
 >(bytea,bytea)
 >=(bytea,bytea)
 ~~(bytea,bytea)
 !~~(bytea,bytea)
 ||(bytea,bytea)
(9 rows)

But this does point out the problem: LIKE (a/k/a ~~) on a bytea wants
a bytea on the righthand side, not text or varchar.  So setString is
the wrong thing to use.

			regards, tom lane
В списке pgsql-jdbc по дате отправления
От: Sylvain Leroux
Дата:
От: Sylvain Leroux
Дата:
FAQ