pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: David Johnston <polobo@yahoo.com>
To: pgsql-bugs@postgresql.org
Subject: Re: BUG #9519: Allows storing scalar json, but fails when querying
Date: Tue, 11 Mar 2014 08:57:48 -0700 (PDT)
Message-ID: <1394553468645-5795538.post@n5.nabble.com> (raw)
In-Reply-To: <CA+tXr-9JSk5YruYQGuYBUo0kbBh_gJoAoi_GnouehKRMvwAaSw@mail.gmail.com>
References: <20140310150952.398.53642@wrigleys.postgresql.org>
	<CAMkU=1xiHuGMBnDTo48D4L5J8sZErkPVCiF7J=yA-joPAx=EBA@mail.gmail.com>
	<CA+tXr-9JSk5YruYQGuYBUo0kbBh_gJoAoi_GnouehKRMvwAaSw@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

Alf Kristian Støyle wrote
> select data #> '{"a"}' from jtest;
>  ?column?
> ----------
> 
> 
>  "b"
> (3 rows)
> 
> 
> select data #> '{"a"}' from jtest where (data #> '{"a"}')::text = 'b';
>  ?column?
> ----------
> (0 rows)
> 
> 
> 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"' = '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-9519-Allows-storing-scalar-json-but-fails-when-querying-...
Sent from the PostgreSQL - bugs mailing list archive at Nabble.com.


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (14+ messages)  latest in thread

Message-ID: <1394553468645-5795538.post@n5.nabble.com>
Permalink:  ../1394553468645-5795538.post@n5.nabble.com/
Also on:    postgresql.org/message-id/1394553468645-5795538.post@n5.nabble.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: polobo@yahoo.com
  Subject: Re: BUG #9519: Allows storing scalar json, but fails when querying
  In-Reply-To: <1394553468645-5795538.post@n5.nabble.com>
  References: <20140310150952.398.53642@wrigleys.postgresql.org> <CAMkU=1xiHuGMBnDTo48D4L5J8sZErkPVCiF7J=yA-joPAx=EBA@mail.gmail.com> <CA+tXr-9JSk5YruYQGuYBUo0kbBh_gJoAoi_GnouehKRMvwAaSw@mail.gmail.com> <1394553468645-5795538.post@n5.nabble.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox