Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cjMW1-00025e-8b for pgsql-jdbc@arkaria.postgresql.org; Thu, 02 Mar 2017 08:55:13 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cjMW0-0000OG-RO for pgsql-jdbc@arkaria.postgresql.org; Thu, 02 Mar 2017 08:55:12 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cjMVU-0006zW-5i for pgsql-jdbc@postgresql.org; Thu, 02 Mar 2017 08:54:40 +0000 Received: from [195.159.176.226] (helo=blaine.gmane.org) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1cjMVR-0000NJ-ED for pgsql-jdbc@postgresql.org; Thu, 02 Mar 2017 08:54:38 +0000 Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1cjMVE-0004TJ-T0 for pgsql-jdbc@postgresql.org; Thu, 02 Mar 2017 09:54:24 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: pgsql-jdbc@postgresql.org From: Thomas Kellerer Subject: Re: JDBC and the hstore ? operator - no longer working with build 1211 Date: Thu, 2 Mar 2017 09:54:22 +0100 Lines: 28 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@blaine.gmane.org 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: X-Host-Lookup-Failed: Reverse DNS lookup failed for 195.159.176.226 (failed) X-Pg-Spam-Score: -0.9 (/) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-jdbc Precedence: bulk Sender: pgsql-jdbc-owner@postgresql.org Vladimir Sitnikov schrieb am 01.11.2016 um 15:00: >>This has been "broken" for a while now, you have to use ?? to get it to work. This still doesn't work completely with a PreparedStatement. Other hstore operators that start with an ? do not work: ?& and ?| e.g.: connection.prepareStatement("select * from foo where hstore_column ?& array['key']"); connection.prepareStatement("select * from foo where hstore_column ?| array['key']"); The prepareStatement() call succeeds, but when calling executeQuery() an exception is thrown: org.postgresql.util.PSQLException: No value specified for parameter 1. The goal is to pass the array as a parameter, something like: Array keys = con.createArrayOf("text", new String[] {"key1","key2"}); connection.prepareStatement("select * from foo where hstore_column ?& ?"); pstmt.setArray(1, keys); ResultSet rs = pstmt.executeQuery(); Tested with 1212 and 42.0.0 Regards Thomas -- Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-jdbc