Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id A648363480B for ; Mon, 31 Aug 2009 06:05:50 -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 74260-06 for ; Mon, 31 Aug 2009 09:05:35 +0000 (UTC) Received: from mx3.hub.org (mx3.hub.org [206.223.169.73]) by mail.postgresql.org (Postfix) with ESMTP id 8CD37633DFB for ; Mon, 31 Aug 2009 06:05:25 -0300 (ADT) X-Greylist: delayed 00:23:49.544112 by SQLgrey-1.7.6 Received: from mail-fx0-f210.google.com (mail-fx0-f210.google.com [209.85.220.210]) by mx3.hub.org (Postfix) with ESMTP id AF40D37CA91 for ; Mon, 31 Aug 2009 03:40:29 -0300 (ADT) Received: by fxm6 with SMTP id 6so2596682fxm.19 for ; Sun, 30 Aug 2009 23:38:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=W1UzgcCLdKu6mFkH997MWqwzkh6gnjgTpx+Kxg9ddcg=; b=sNtFwodtZCRUec8S3d4eV4vPtCMV6+y/+e7G+I7mDtlAQu2ZshjNNX0ZNZjsIZlgyA hjomJMkHwjS2UkDXChV3NvZOhoKXp6rjhYAYtFQ7xIfGX/AlRIeKfsduviLKjLW9f2VJ RWM6mmhVB5QoP3kZdAPj3TI0KAF2hap24O8ls= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=Cz8w44mxFIfq4WVWZTjvwKOb/AZ3ANbGkHJyEzQrMUKvAsKue/vcVRZK0da31bFQuZ ZgaZ6W3gk5tpWncfhHQ6I0lWJ5s0p7abAEO2h7mJqzPmYN8GHrEYl/Xf2GL1WBPw1H+U +RSj2Pl6f+EOk0TOLKzF4VFSb/goXJn0czYs8= MIME-Version: 1.0 Received: by 10.204.148.76 with SMTP id o12mr3892964bkv.147.1251698796510; Sun, 30 Aug 2009 23:06:36 -0700 (PDT) In-Reply-To: <4A9AF477.5040706@wanadoo.fr> References: <6fb522db0908301333o3bfeb6e9l5c2ad9dd04308e18@mail.gmail.com> <4A9AF477.5040706@wanadoo.fr> Date: Mon, 31 Aug 2009 08:06:36 +0200 Message-ID: <6fb522db0908302306n7fcda5f7ncd7423f650855dca@mail.gmail.com> Subject: Re: Search content within a bytea field From: Damiano Bolzoni To: Sylvain Leroux Cc: pgsql-jdbc@postgresql.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.67 tagged_above=-10 required=5 tests=AWL=0.930, BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 200908/94 X-Sequence-Number: 19943 > 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?