Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 35FF86347C3 for ; Mon, 31 Aug 2009 05:49:30 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 70606-04-6 for ; Mon, 31 Aug 2009 08:49:14 +0000 (UTC) Received: from mx3.hub.org (mx3.hub.org [206.223.169.73]) by mail.postgresql.org (Postfix) with ESMTP id CA40C6357AC for ; Mon, 31 Aug 2009 05:42:39 -0300 (ADT) X-Greylist: delayed 00:26:59.92168 by SQLgrey-1.7.6 Received: from smtp27.orange.fr (smtp27.orange.fr [80.12.242.94]) by mx3.hub.org (Postfix) with ESMTP id 3CC7437C889 for ; Mon, 31 Aug 2009 05:06:23 -0300 (ADT) Received: from smtp27.orange.fr (mwinf2721 [10.232.12.121]) by mwinf2705.orange.fr (SMTP Server) with ESMTP id 2A6BE1C01E46 for ; Mon, 31 Aug 2009 09:39:28 +0200 (CEST) Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf2721.orange.fr (SMTP Server) with ESMTP id 7A2DD1C00090; Mon, 31 Aug 2009 09:38:52 +0200 (CEST) Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf2721.orange.fr (SMTP Server) with ESMTP id 6B7F01C00097; Mon, 31 Aug 2009 09:38:52 +0200 (CEST) Received: from [10.129.36.10] (Mix-Rennes201-1-129.w193-250.abo.wanadoo.fr [193.250.26.129]) by mwinf2721.orange.fr (SMTP Server) with ESMTP id 9947F1C00090; Mon, 31 Aug 2009 09:38:51 +0200 (CEST) X-ME-UUID: 20090831073851627.9947F1C00090@mwinf2721.orange.fr Message-ID: <4A9B7E09.1000300@wanadoo.fr> Date: Mon, 31 Aug 2009 09:38:49 +0200 From: Sylvain Leroux Organization: http://www.chicoree.fr User-Agent: Thunderbird 2.0.0.23 (Macintosh/20090812) MIME-Version: 1.0 To: pgsql-jdbc@postgresql.org CC: Tom Lane Subject: Re: Search content within a bytea field References: <6fb522db0908301333o3bfeb6e9l5c2ad9dd04308e18@mail.gmail.com> <4A9AF477.5040706@wanadoo.fr> <4017.1251673129@sss.pgh.pa.us> In-Reply-To: <4017.1251673129@sss.pgh.pa.us> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.001 tagged_above=-10 required=5 tests=BAYES_50=0.001 X-Spam-Level: X-Archive-Number: 200908/92 X-Sequence-Number: 19941 Hi, And sorry for that: Tom Lane a écrit : > 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 ... But I was quite sure to have read that somewhere -- and indeed: (in "PostgreSQL - second edition / ISBN:978-0-672-32756-8) "PostgreSQL offers a single BYTEA operator: concatenation. [...] Note that you can't compare two BYTEA values, even for equality/inequality. You can of course convert a BYTEA value into another value using CAST() operator, and that opens up other operators." I remember having found that annoying at the time - that's why I remembered it. But it appears this statement was outdated -- or simple false all along? Anyway once again sorry for the misinformation. Sylvain. -- Website: http://www.chicoree.fr