Re: bug in jsonb_set postgresql 5.5

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: bug in jsonb_set postgresql 5.5
Дата
Msg-id CAKFQuwaUxXcWPi6p+JVo-6WuKc_7CJDswHHkvqh5KYp3OZwGow@mail.gmail.com
обсуждение исходный текст
Ответ на bug in jsonb_set porstgresql 5.5  (Pascal Barbedor <pbarbedor@blset.com>)
Список pgsql-bugs
On Thu, Feb 22, 2018 at 8:51 AM, Pascal Barbedor <pbarbedor@blset.com> wrote:
Thanks for the answer

Where is this mentioned in the doc ?

Since it is only a key inside the json object which is assigned the null value, does it mean it is impossible to have null values inside the jsonb object ?


​The docs don't indicate whether functions are strict or not (nor apparently does psql's \df+)...but the behavior of strict functions is documented (at least in CREATE FUNCTION for when you are creating your own).

It is indeed impossible to place an SQL NULL inside of a json object - you can place a json null inside a json object though - thus you need to convert from SQL NULL to json null explicitly (typically via COALESCE):

jsonb_set​(history, '{q1,obs}', COALESCE(to_jsonb(obs), 'null'))

David J.

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

Предыдущее
От: Pascal Barbedor
Дата:
Сообщение: Re: bug in jsonb_set postgresql 5.5
Следующее
От: PG Bug reporting form
Дата:
Сообщение: BUG #15077: Unable to receive data from WAL Stream Error