bug in jsonb_set porstgresql 5.5

From: Pascal Barbedor <pbarbedor(at)blset(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: bug in jsonb_set porstgresql 5.5
Date: 2018-02-22 13:38:25
Message-ID: F3D79256-EB69-4092-A958-5F0C9E2AC9AE@blset.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

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

Those three instructions were sent to postgresql

1- this one is ok, set the field to an empty object
update table1 set history=‘{}’

2- this one is ok, creates a key q1 initialized at an empty object
update table1 set history=jsonb_set(history,’{q1}’, ‘{}’)

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))

this is on postgresql 5.5

Best regards

Pascal BARBEDOR

tel 01 45 34 55 25
mob 06 82 32 69 63

http://www.blset.com
tel 01 46 23 86 74
fax 09 72 42 01 93

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2018-02-22 15:12:22 Re: BUG #15076: postmaster crashes unexpectedly when using up arrow key in psql command
Previous Message Claudio Freire 2018-02-22 11:27:11 Re: pg_upgrade and materialized views