pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Christoph Moench-Tegeder <cmt@burggraben.net>
To: Ariadne Conill <ariadne@dereferenced.org>
Cc: pgsql-general@lists.postgresql.org
Cc: feld@freebsd.org
Subject: Re: jsonb_set() strictness considered harmful to data
Date: Sat, 19 Oct 2019 00:57:52 +0200
Message-ID: <20191018225752.GC56427@elch.exwg.net> (raw)
In-Reply-To: <CAAOiGNz85fHbzyM6iXQxXECc1GDqey2Ve39mUB2mcJSZWTa7zg@mail.gmail.com>
References: <CAAOiGNwUsgM-UBqsJH_mriCFr-JCPxD+pQoXNvyOEQPc+YHQRQ@mail.gmail.com>
	<20191018215018.GB56427@elch.exwg.net>
	<CAAOiGNz85fHbzyM6iXQxXECc1GDqey2Ve39mUB2mcJSZWTa7zg@mail.gmail.com>

## 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





view thread (83+ messages)  latest in thread

Message-ID: <20191018225752.GC56427@elch.exwg.net>
Permalink:  ../20191018225752.GC56427@elch.exwg.net/
Also on:    postgresql.org/message-id/20191018225752.GC56427@elch.exwg.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: cmt@burggraben.net, ariadne@dereferenced.org, feld@freebsd.org
  Subject: Re: jsonb_set() strictness considered harmful to data
  In-Reply-To: <20191018225752.GC56427@elch.exwg.net>
  References: <CAAOiGNwUsgM-UBqsJH_mriCFr-JCPxD+pQoXNvyOEQPc+YHQRQ@mail.gmail.com> <20191018215018.GB56427@elch.exwg.net> <CAAOiGNz85fHbzyM6iXQxXECc1GDqey2Ve39mUB2mcJSZWTa7zg@mail.gmail.com> <20191018225752.GC56427@elch.exwg.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox