Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZyxPn-0007qU-Mh for pgsql-jdbc@arkaria.postgresql.org; Wed, 18 Nov 2015 07:44:27 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZyxPm-000269-OI for pgsql-jdbc@arkaria.postgresql.org; Wed, 18 Nov 2015 07:44:26 +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) (envelope-from ) id 1ZyxPl-00025w-4j for pgsql-jdbc@postgresql.org; Wed, 18 Nov 2015 07:44:25 +0000 Received: from plane.gmane.org ([80.91.229.3]) by makus.postgresql.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1ZyxPd-0004GV-EH for pgsql-jdbc@postgresql.org; Wed, 18 Nov 2015 07:44:23 +0000 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1ZyxPY-0003os-Fm for pgsql-jdbc@postgresql.org; Wed, 18 Nov 2015 08:44:12 +0100 Received: from 185.40.248.10 ([185.40.248.10]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 18 Nov 2015 08:44:12 +0100 Received: from spam_eater by 185.40.248.10 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 18 Nov 2015 08:44:12 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: pgsql-jdbc@postgresql.org From: Thomas Kellerer Subject: State of the support for the hstore ? operator Date: Wed, 18 Nov 2015 08:44:04 +0100 Lines: 27 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 185.40.248.10 X-Mozilla-News-Host: news://news.gmane.org:119 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 X-Pg-Spam-Score: -0.8 (/) 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 Hello, I just stumbled upon this (using postgresql-9.4-1205.jdbc42.jar) Statement stmt = con.createStatement(); ResultSet rs = stmt.executeQuery("select count(*) from product where attributes ? 'location_id'"); results in org.postgresql.util.PSQLException: ERROR: syntax error at or near "$1" "product.attributes" is a hstore column: I recall a discussion about this problem a while ago, but I can't find it any more. While I certainly would expect a problem when using a PreparedStatement I am surprised that a "plain" executeQuerys() also tries to do parameter replacement. I have found the suggestion to use exist(attributes, 'location_id') but that is not an option as that does not use the index on the column. So what is the state of this? Do we have a way of escaping the ? operator? I couldn't find anything in the documentation. 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