BUG #13961: Unexpected behaviour of JSONB_SET if the new_value is null - Mailing list pgsql-bugs

From pravin@gida.in
Subject BUG #13961: Unexpected behaviour of JSONB_SET if the new_value is null
Date
Msg-id 20160215080240.2605.67223@wrigleys.postgresql.org
Whole thread Raw
Responses Re: BUG #13961: Unexpected behaviour of JSONB_SET if the new_value is null  ("David G. Johnston" <david.g.johnston@gmail.com>)
List pgsql-bugs
The following bug has been logged on the website:

Bug reference:      13961
Logged by:          Pravin Carvalho
Email address:      pravin@gida.in
PostgreSQL version: 9.5.1
Operating system:   All
Description:

If the new_value is null, JSONB_SET evaluates to null. This is not mentioned
in the documentation and intuitively I would expect this set the value of
the key at the specified path as null.
eg. SELECT jsonb_set('{"f1":1,"f2":2}', '{f2}',null);

I was using JSONB_SET to update a JSONB column where the new_value was the
result of the query and this could have led to loss of data.

pgsql-bugs by date:

Previous
From: jsosic@gmail.com
Date:
Subject: BUG #13959: Missing tmpfile exclude conf for socket
Next
From: chandrakant sharma
Date:
Subject: Row count mismatch post pg_dump piped restore