Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 8072B632454 for ; Mon, 31 Aug 2009 11:21:48 -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 35223-10 for ; Mon, 31 Aug 2009 14:21:28 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by mail.postgresql.org (Postfix) with ESMTP id 9FFBC6332F3 for ; Mon, 31 Aug 2009 11:21:37 -0300 (ADT) Received: from list by lo.gmane.org with local (Exim 4.50) id 1Mi7lD-00066v-Mq for pgsql-jdbc@postgresql.org; Mon, 31 Aug 2009 16:21:31 +0200 Received: from 217.110.94.67 ([217.110.94.67]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 31 Aug 2009 16:21:31 +0200 Received: from spam_eater by 217.110.94.67 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 31 Aug 2009 16:21:31 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: pgsql-jdbc@postgresql.org From: Thomas Kellerer Subject: Re: Search content within a bytea field Date: Mon, 31 Aug 2009 16:21:16 +0200 Lines: 17 Message-ID: References: <6fb522db0908301333o3bfeb6e9l5c2ad9dd04308e18@mail.gmail.com> <4A9AF477.5040706@wanadoo.fr> <6fb522db0908302306n7fcda5f7ncd7423f650855dca@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 217.110.94.67 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.23) Gecko/20090812 Thunderbird/2.0.0.23 Mnenhy/0.7.6.666 In-Reply-To: <6fb522db0908302306n7fcda5f7ncd7423f650855dca@mail.gmail.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.532 tagged_above=-10 required=5 tests=BAYES_00=-2.599, RCVD_NUMERIC_HELO=2.067 X-Spam-Level: X-Archive-Number: 200908/97 X-Sequence-Number: 19946 Damiano Bolzoni, 31.08.2009 08:06: > 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? This looks _very_ strange (if not even wrong) to me. If you are storing character data, why don't you use the text datatype? Thomas