Re: jsonb_set() strictness considered harmful to data

From: Andrew Dunstan <andrew(dot)dunstan(at)2ndquadrant(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>, "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, Floris Van Nee <florisvannee(at)optiver(dot)com>, Ariadne Conill <ariadne(at)dereferenced(dot)org>, Mark Felder <feld(at)freebsd(dot)org>, "pgsql-generallists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: jsonb_set() strictness considered harmful to data
Date: 2020-01-06 21:34:34
Message-ID: CAA8=A79Z_zkWbRGGsPn6Sho53H=M=-ajX09Gy++coE_kGmMuEw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

On Thu, Nov 28, 2019 at 2:15 PM Andrew Dunstan
<andrew(dot)dunstan(at)2ndquadrant(dot)com> wrote:
>
>
> On 11/27/19 9:35 PM, Michael Paquier wrote:
> > On Fri, Nov 15, 2019 at 09:45:59PM +0100, Pavel Stehule wrote:
> >> Maybe ERRCODE_NULL_VALUE_NOT_ALLOWED, and "NULL is not allowed",
> >> errdetail - a exception due setting "null_value_treatment" =>
> >> raise_exception
> >> and maybe some errhint - "Maybe you would to use Jsonb NULL - "null"::jsonb"
> >>
> >> I don't know, but in this case, the exception should be verbose. This is
> >> "rich" function with lot of functionality
> > @Andrew: This patch is waiting on input from you for a couple of days
> > now.
> >
>
>

Updated version including docco and better error message.

cheers

andrew

--
Andrew Dunstan https://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Attachment Content-Type Size
jsonb_set_lax-2.patch text/x-patch 9.3 KB

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Michael Lewis 2020-01-06 21:38:53 Re: UPDATE many records
Previous Message Mark Zellers 2020-01-06 21:33:57 RE: UPDATE many records

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2020-01-06 21:38:17 Re: weird libpq GSSAPI comment
Previous Message Stephen Frost 2020-01-06 21:32:39 Re: TRUNCATE on foreign tables