The following bug has been logged on the website:
Bug reference: 15075
Logged by: Sylvain Claudel
Email address: claudel.sylvain@gmail.com
PostgreSQL version: 10.1
Operating system: MacOSX
Description:
This behavior is it normal ?
select jsonb_set('{"f1":1,"f2":null,"f3":"bidule"}', '{f3}', null, false);
#> [null]
select jsonb_set('{"f1":1,"f2":null,"f3":"bidule"}', '{f3}', 'null',
false);
#> {"f1":1,"f2":null,"f3":null}
In a update query, it is dangerous.
It may be better that the request crashes rather than executing with
surprising behavior.
Tested in postgresql 9.6.4 and 10.1 but nothing on the changelog concerning
jsonb_set since 9.6.1.
Sorry if this report is not "clean".