pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Ivan E. Panchenko <i.panchenko@postgrespro.ru>
Cc: Dmitry Dolgov <9erthalion6@gmail.com>
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #15140: Incorrect jsonb_set behavoir
Date: Mon, 02 Apr 2018 11:02:49 -0400
Message-ID: <2394.1522681369@sss.pgh.pa.us> (raw)
In-Reply-To: <3ab7ce91-9d9e-8b82-e77f-73d2da52c17e@postgrespro.ru>
References: <152266540508.1442.16790414733320933622@wrigleys.postgresql.org>
	<CA+q6zcWorxezaaN9RQgURkmiyjer3nT8_zO2Sp6700FaROVk5Q@mail.gmail.com>
	<3ab7ce91-9d9e-8b82-e77f-73d2da52c17e@postgrespro.ru>

"Ivan E. Panchenko" <i.panchenko@postgrespro.ru> writes:
> Thanks for the workaround.  Nevertheless, this behavior looks 
> counter-intuitive, and I would vote for removing strictness from this 
> function.

That would amount to assuming that SQL NULL and JSON 'null' are
interchangeable, which isn't the case elsewhere, and I'm not sure
we want it to be the case here.  You can get the behavior you're
looking for with jsonb_set(..., COALESCE(fieldvalue, 'null')).

			regards, tom lane




view thread (4+ messages)

Message-ID: <2394.1522681369@sss.pgh.pa.us>
Permalink:  ../2394.1522681369@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2394.1522681369@sss.pgh.pa.us

 · 

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-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, i.panchenko@postgrespro.ru, 9erthalion6@gmail.com
  Subject: Re: BUG #15140: Incorrect jsonb_set behavoir
  In-Reply-To: <2394.1522681369@sss.pgh.pa.us>
  References: <152266540508.1442.16790414733320933622@wrigleys.postgresql.org> <CA+q6zcWorxezaaN9RQgURkmiyjer3nT8_zO2Sp6700FaROVk5Q@mail.gmail.com> <3ab7ce91-9d9e-8b82-e77f-73d2da52c17e@postgrespro.ru> <2394.1522681369@sss.pgh.pa.us>

* 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