Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 9B9391337B4A for ; Mon, 27 Dec 2010 15:47:28 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 04180-01 for ; Mon, 27 Dec 2010 19:47:21 +0000 (UTC) X-Greylist: delayed 00:07:18.978193 by SQLgrey-1.7.6 Received: from alexander.swishmail.com (alexander.swishmail.com [208.72.56.31]) by mail.postgresql.org (Postfix) with ESMTP id 335BD1337B64 for ; Mon, 27 Dec 2010 15:47:21 -0400 (AST) Received: (qmail 33538 invoked by uid 89); 27 Dec 2010 19:40:00 -0000 Received: from unknown (HELO ?127.0.0.1?) (eric.schwarzenbach@wrycan.com@209.6.47.112) by alexander.swishmail.com with ESMTPA; 27 Dec 2010 19:40:00 -0000 Message-ID: <4D18EB8D.8040407@blackbrook.org> Date: Mon, 27 Dec 2010 14:39:57 -0500 From: Eric Schwarzenbach 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.5.0 MIME-Version: 1.0 To: pgsql-bugs@postgresql.org Subject: IN clause on BYTEA column works against table directly but gives error against view Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-5 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001 X-Spam-Level: X-Archive-Number: 201012/180 X-Sequence-Number: 28986 I've got a SELECT with a WHERE clause using IN against a BYTEA column which works when I'm querying against the table directly. However when I substitute an equivalent view in my query (a view made of several inner joins which simply carry over that same BYTEA column), I get the error: operator does not exist: "integer = bytea" I've googled this error and read how certain syntax against BYTEA which worked in older versions of PostgreSQL stopped working at some point when some implicit conversion rules were tightened up. I'm not sure of the relevance of this to my situation given the change in behavior between table vs view. My query is occurring via JDBC, using a prepared statement, where I'm passing a byte array for each parameter in the IN clause, using the setObject(int, Object) method. I've tried this on PostgreSQL versions 8.3.1, and 8.4.5, and have tried various versions of the JDBC drivers. I'll try working around this by having my code create escaped octal syntax instead of passing a byte array, or possibly by passing a SQL type code. But I thought I should see if anyone had some idea why a table vs a view should produce different behavior like this, and if there were any other workarounds or caveats about what may be going on that I should be aware of... Regards, Eric