Re: BUG #9519: Allows storing scalar json, but fails when querying - Mailing list pgsql-bugs

From John R Pierce
Subject Re: BUG #9519: Allows storing scalar json, but fails when querying
Date
Msg-id 531E2977.7060002@hogranch.com
Whole thread Raw
In response to Re: BUG #9519: Allows storing scalar json, but fails when querying  (Alf Kristian Støyle <alf.kristian@gmail.com>)
Responses Re: BUG #9519: Allows storing scalar json, but fails when querying  (David Johnston <polobo@yahoo.com>)
List pgsql-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

pgsql-bugs by date:

Previous
From: Alf Kristian Støyle
Date:
Subject: Re: BUG #9519: Allows storing scalar json, but fails when querying
Next
From: David Johnston
Date:
Subject: Re: BUG #9519: Allows storing scalar json, but fails when querying