jsonb_set() strictness considered harmful to data - Mailing list pgsql-general

From Floris Van Nee
Subject jsonb_set() strictness considered harmful to data
Date
Msg-id 1571560798575.47024@Optiver.com
Whole thread Raw
In response to Re: jsonb_set() strictness considered harmful to data  (Ariadne Conill <ariadne@dereferenced.org>)
Responses Re: jsonb_set() strictness considered harmful to data
Re: jsonb_set() strictness considered harmful to data
List pgsql-general

FWIW I've been bitten by this 'feature' more than once as well, accidentally erasing a column. Now I usually write js = jsonb_set(js, coalesce(new_column, 'null'::jsonb)) to prevent erasing the whole column, and instead setting the value to a jsonb null value, but I also found the STRICT behavior very surprising at first..


-Floris

pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: releasing space
Next
From: Steve Atkins
Date:
Subject: Re: jsonb_set() strictness considered harmful to data