pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: John R Pierce <pierce@hogranch.com>
To: pgsql-bugs@postgresql.org
Subject: Re: BUG #9519: Allows storing scalar json, but fails when querying
Date: Mon, 10 Mar 2014 14:07:03 -0700
Message-ID: <531E2977.7060002@hogranch.com> (raw)
In-Reply-To: <CA+tXr--Z7ap5mcaBVNKOi9NXd2MaZG9FO4t7cVj3cCMZjz+g6g@mail.gmail.com>
References: <20140310150952.398.53642@wrigleys.postgresql.org>
	<531E17E1.9020009@joh.to>
	<CA+tXr--Z7ap5mcaBVNKOi9NXd2MaZG9FO4t7cVj3cCMZjz+g6g@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

On 3/10/2014 1:39 PM, Alf Kristian Støyle wrote:
> This is the "unfortunate" part:
> /select data->>'foo' from jtest;
> => ERROR:  cannot extract element from a scalar
> /
> So either, only accept JSON object (not simple JSON values), or make 
> the JSON query operators work with JSON values as well.

the json ->> 'fieldname' operator has no meaning when applied to a 
scalar value.    what would you suggest it should do?   return a NULL ?



-- 
john r pierce                                      37N 122W
somewhere on the middle of the left coast

view thread (14+ messages)  latest in thread

Message-ID: <531E2977.7060002@hogranch.com>
Permalink:  ../531E2977.7060002@hogranch.com/
Also on:    postgresql.org/message-id/531E2977.7060002@hogranch.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: pierce@hogranch.com
  Subject: Re: BUG #9519: Allows storing scalar json, but fails when querying
  In-Reply-To: <531E2977.7060002@hogranch.com>
  References: <20140310150952.398.53642@wrigleys.postgresql.org> <531E17E1.9020009@joh.to> <CA+tXr--Z7ap5mcaBVNKOi9NXd2MaZG9FO4t7cVj3cCMZjz+g6g@mail.gmail.com> <531E2977.7060002@hogranch.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