Why does jsonb_set() remove non-mentioned keys?

Поиск
Список
Период
Сортировка
От Thomas Kellerer
Тема Why does jsonb_set() remove non-mentioned keys?
Дата
Msg-id qfkua9$2q0e$1@blaine.gmane.org
обсуждение исходный текст
Ответы Re: Why does jsonb_set() remove non-mentioned keys?  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-general
Why does 

   select jsonb_set('{"foo": 1}'::jsonb, '{bar}', to_jsonb(null::int), true)

return NULL when all it should do is to add a second key?

I would expect {"foo": 1, "bar": null} or no change at all to the original JSON value, but not that the whole JSON is
setto null. 
 

In the original case the new value to be set was the result of an expression, not a "hardcoded" null value.
 
Thomas






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

Предыдущее
От: Andrey Sychev
Дата:
Сообщение: Error: rows returned by function are not all of the same row type
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Error: rows returned by function are not all of the same row type