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

Поиск
Список
Период
Сортировка
От Christian Kruse
Тема Re: BUG #9519: Allows storing scalar json, but fails when querying
Дата
Msg-id 20140311075030.GC9524@defunct.ch
обсуждение исходный текст
Ответ на Re: BUG #9519: Allows storing scalar json, but fails when querying  (David Johnston <polobo@yahoo.com>)
Ответы Re: BUG #9519: Allows storing scalar json, but fails when querying
Список pgsql-bugs
Hi,

On 10/03/14 14:09, David Johnston wrote:

> The system supposes that, at a structural level, you are dealing with
> column-consistent data and so if you ask for something that does not make
> sense (i.e., an object key when you have an array or a scalar) it will wa=
rn
> you.

Looking at the common usage of JSON it doesn't seem to be a good idea
to imply column-consistent JSON. Normally when JSON is used the
application ensures consistency and when a non-existent key is
accessed NULL is returned. I think this is expected behavior and we
should do it like that, too; if one wants it different, he should use
CHECK constraints.

Best regards,

--=20
 Christian Kruse               http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services

В списке pgsql-bugs по дате отправления:

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