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

Поиск
Список
Период
Сортировка
От John R Pierce
Тема Re: BUG #9519: Allows storing scalar json, but fails when querying
Дата
Msg-id 531E2977.7060002@hogranch.com
обсуждение исходный текст
Ответ на Re: BUG #9519: Allows storing scalar json, but fails when querying  (Alf Kristian Støyle <alf.kristian@gmail.com>)
Ответы Re: BUG #9519: Allows storing scalar json, but fails when querying  (David Johnston <polobo@yahoo.com>)
Список 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 по дате отправления:

Предыдущее
От: Alf Kristian Støyle
Дата:
Сообщение: Re: BUG #9519: Allows storing scalar json, but fails when querying
Следующее
От: David Johnston
Дата:
Сообщение: Re: BUG #9519: Allows storing scalar json, but fails when querying