Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WNP3z-0005uZ-7y for pgsql-bugs@arkaria.postgresql.org; Tue, 11 Mar 2014 15:57:56 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WNP3y-0006Po-NA for pgsql-bugs@arkaria.postgresql.org; Tue, 11 Mar 2014 15:57:54 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WNP3x-0006Of-A4 for pgsql-bugs@postgresql.org; Tue, 11 Mar 2014 15:57:53 +0000 Received: from sam.nabble.com ([216.139.236.26]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WNP3u-0002b1-8B for pgsql-bugs@postgresql.org; Tue, 11 Mar 2014 15:57:52 +0000 Received: from [192.168.236.26] (helo=sam.nabble.com) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1WNP3s-0000Zj-L3 for pgsql-bugs@postgresql.org; Tue, 11 Mar 2014 08:57:48 -0700 Date: Tue, 11 Mar 2014 08:57:48 -0700 (PDT) From: David Johnston To: pgsql-bugs@postgresql.org Message-ID: <1394553468645-5795538.post@n5.nabble.com> In-Reply-To: References: <20140310150952.398.53642@wrigleys.postgresql.org> Subject: Re: BUG #9519: Allows storing scalar json, but fails when querying MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Pg-Spam-Score: 1.8 (+) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org Alf Kristian St=C3=B8yle wrote > select data #> '{"a"}' from jtest; > ?column? > ---------- >=20 >=20 > "b" > (3 rows) >=20 >=20 > select data #> '{"a"}' from jtest where (data #> '{"a"}')::text =3D 'b'; > ?column? > ---------- > (0 rows) >=20 >=20 > Am I doing a wrong conversion here, or is something else going on? If the > data in the database did not contain scalar values, then ->> works fine in > WHERE. The following is almost the query we are actually trying run > (checking for existence): Side not - please follow the example set by others and trim your quoting and bottom-post. As to your comment - the example above shows that the where clause is evaluating to: Where '"b"' =3D 'b' -- which is false. Maybe try #>> which is defined to return text instead of an object. David J. -- View this message in context: http://postgresql.1045698.n5.nabble.com/BUG-9= 519-Allows-storing-scalar-json-but-fails-when-querying-tp5795417p5795538.ht= ml Sent from the PostgreSQL - bugs mailing list archive at Nabble.com. --=20 Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs