Re: BUG #15140: Incorrect jsonb_set behavoir - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #15140: Incorrect jsonb_set behavoir
Date
Msg-id 2394.1522681369@sss.pgh.pa.us
Whole thread Raw
In response to Re: BUG #15140: Incorrect jsonb_set behavoir  ("Ivan E. Panchenko" <i.panchenko@postgrespro.ru>)
List pgsql-bugs
"Ivan E. Panchenko" <i.panchenko@postgrespro.ru> writes:
> Thanks for the workaround.  Nevertheless, this behavior looks 
> counter-intuitive, and I would vote for removing strictness from this 
> function.

That would amount to assuming that SQL NULL and JSON 'null' are
interchangeable, which isn't the case elsewhere, and I'm not sure
we want it to be the case here.  You can get the behavior you're
looking for with jsonb_set(..., COALESCE(fieldvalue, 'null')).

            regards, tom lane


pgsql-bugs by date:

Previous
From: "Ivan E. Panchenko"
Date:
Subject: Re: BUG #15140: Incorrect jsonb_set behavoir
Next
From: Bruce Momjian
Date:
Subject: Re: BUG #15112: Unable to run pg_upgrade with earthdistance extension