Re: bug in jsonb_set porstgresql 5.5

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: bug in jsonb_set porstgresql 5.5
Дата
Msg-id CAKFQuwYSLegY5M45SeOaVw_HmAavJPij7-xtwOS=bZjwTgXBVQ@mail.gmail.com
обсуждение исходный текст
Ответ на bug in jsonb_set porstgresql 5.5  (Pascal Barbedor <pbarbedor@blset.com>)
Ответы Re: bug in jsonb_set postgresql 5.5
Список pgsql-bugs
On Thu, Feb 22, 2018 at 6:38 AM, Pascal Barbedor <pbarbedor@blset.com> wrote:
Hello


I noticed a problem with a jsonb field and jsonb_set function


- table1 is a table with history a jsonb field, and obs a text field which is null

​[...]​
 
3- this one resets completely the jsonb field, not only the key obs is not set to null but the entire jsonb field is now null

update table1 set history=jsonb_set(history,’{q1,obs}’, to_jsonb(obs))

​Working as designed - jsonb_set​ and to_jsonb are both defined as "NULL ON NULL INPUT (i.e., STRICT)" - since "obs [is] a text field which is null" the final result of the function call is NULL.

​David J.

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: BUG #15076: postmaster crashes unexpectedly when using up arrow key in psql command
Следующее
От: Thomas Kellerer
Дата:
Сообщение: Re: bug in jsonb_set porstgresql 5.5