Re: BUG #9519: Allows storing scalar json, but fails when querying

From: John R Pierce <pierce(at)hogranch(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #9519: Allows storing scalar json, but fails when querying
Date: 2014-03-10 21:07:03
Message-ID: 531E2977.7060002@hogranch.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message David Johnston 2014-03-10 21:09:02 Re: BUG #9519: Allows storing scalar json, but fails when querying
Previous Message Alf Kristian Støyle 2014-03-10 20:39:45 Re: BUG #9519: Allows storing scalar json, but fails when querying