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

From Christoph Moench-Tegeder
Subject Re: jsonb_set() strictness considered harmful to data
Date
Msg-id 20191018225752.GC56427@elch.exwg.net
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
List pgsql-general
## Ariadne Conill (ariadne@dereferenced.org):

> Why don't we fix the database engine to not eat data when the
> jsonb_set() operation fails?

It didn't fail, it worked like SQL (you've been doing SQL for too
long when you get used to the NULL propagation, but that's still
what SQL does - check "+" for example).
And changing a function will cause fun for everyone who relies on
the current behaviour - so at least it shouldn't be done on a whim
(some might argue that a whim was what got us into this situation
in the first place).

Continuing along that thought, I'd even argue that your are
writing code which relies on properties of the data which you never
guaranteed. There is a use case for data types and constraints.
Not that I'm arguing for maximum surprise in programming, but
I'm a little puzzled when people eschew thew built-in tools and
start implmenting them again side-to-side with what's already
there.

Regards,
Christoph

-- 
Spare Space



pgsql-general by date:

Previous
From: Ariadne Conill
Date:
Subject: Re: jsonb_set() strictness considered harmful to data
Next
From: Adrian Klaver
Date:
Subject: Re: jsonb_set() strictness considered harmful to data