From: Tom Lane <tgl@sss.pgh.pa.us>
To: Thomas Kellerer <spam_eater@gmx.net>
Cc: Марк <kolypto@gmail.com>
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: Unexpected behavior of jsonb_set() with a `null` value
Date: Thu, 12 Sep 2019 10:32:00 -0400
Message-ID: <19278.1568298720@sss.pgh.pa.us> (raw)
In-Reply-To: <db9745f5-0d85-ed97-9911-9644957be2fc@gmx.net>
References: <CAOA+1AxbrhVm0HBTDcB97Gmtwp2Nc_qUv2tTbKESusoAQVBexw@mail.gmail.com>
<db9745f5-0d85-ed97-9911-9644957be2fc@gmx.net>
Thomas Kellerer <spam_eater@gmx.net> writes:
> Марк schrieb am 12.09.2019 um 12:55:
>> The expected behavior is, perhaps, to convert an SQL `NULL` value to JSONB null value: 'null'::jsonb
> I have asked the same: https://www.postgresql.org/message-id/flat/qfkua9%242q0e%241%40blaine.gmane.org
There are other more-apropos threads in the archives, though I'm too
lazy to go find them right now. IMO the problem here is an assumption
that SQL NULL should be interchangeable with a JSON NULL. It's not,
and we don't intend to make it so, because (a) the definitional quagmire
that would result is bottomless; (b) people asking for this are generally
trying to use SQL NULL as a live data value, which is almost always just
a bad idea.
regards, tom lane
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, spam_eater@gmx.net, kolypto@gmail.com
Subject: Re: Unexpected behavior of jsonb_set() with a `null` value
In-Reply-To: <19278.1568298720@sss.pgh.pa.us>
References: <CAOA+1AxbrhVm0HBTDcB97Gmtwp2Nc_qUv2tTbKESusoAQVBexw@mail.gmail.com> <db9745f5-0d85-ed97-9911-9644957be2fc@gmx.net> <19278.1568298720@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