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

From Laurenz Albe
Subject Re: jsonb_set() strictness considered harmful to data
Date
Msg-id d502306ecbad6b6fc5b02db80c82030c87e1497d.camel@cybertec.at
Whole thread Raw
In response to Re: jsonb_set() strictness considered harmful to data  ("David G. Johnston" <david.g.johnston@gmail.com>)
Responses Re: jsonb_set() strictness considered harmful to data
Re: jsonb_set() strictness considered harmful to data
List pgsql-general
David G. Johnston wrote:
> Now if only the vast majority of users could have and keep this level of understanding
> in mind while writing complex queries so that they remember to always add protections
> to compensate for the unique design decision that SQL has taken here...

You can only say that if you don't understand NULL (you wouldn't be alone).
If I modify a JSON with an unknown value, the result is unknown.
This seems very intuitive to me.

One could argue that whoever uses SQL should understand SQL.

But I believe that it is reasonable to suppose that many people who
use JSON in the database are more savvy with JSON than with SQL
(they might not have chosen JSON otherwise), so I agree that it makes
sense to change this particular behavior.

Yours,
Laurenz Albe
-- 
Cybertec | https://www.cybertec-postgresql.com




pgsql-general by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: jsonb_set() strictness considered harmful to data
Next
From: "Abraham, Danny"
Date:
Subject: date function bug