From: Thomas Kellerer <spam_eater@gmx.net>
To: pgsql-bugs@postgresql.org
Subject: Re: bug in jsonb_set porstgresql 5.5
Date: Thu, 22 Feb 2018 16:51:13 +0100
Message-ID: <p6mopi$vc8$1@blaine.gmane.org> (raw)
In-Reply-To: <F3D79256-EB69-4092-A958-5F0C9E2AC9AE@blset.com>
References: <F3D79256-EB69-4092-A958-5F0C9E2AC9AE@blset.com>
Pascal Barbedor schrieb am 22.02.2018 um 14:38:
> I noticed a problem with a jsonb field and jsonb_set function
>
> - table1 is a table with *history* a jsonb field, and *obs* a text field which is null
>
> Those three instructions were sent to postgresql
>
> 1- this one is ok, set the field to an empty object
> *update table1 set history=‘{}’*
>
> 2- this one is ok, creates a key q1 initialized at an empty object
> *update table1 set history=jsonb_set(history,’{q1}’, ‘{}’)*
>
> *3- this one resets completely the jsonb field, not only the key obs is not set to null but the entire jsonb field is now null*
> *
> *
> *update table1 set history=jsonb_set(history,’{q1,obs}’, to_jsonb(obs))*
>
> this is on postgresql 5.5
There is no PostgreSQL 5.5 (and never was if I'm not mistaken)
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: spam_eater@gmx.net
Subject: Re: bug in jsonb_set porstgresql 5.5
In-Reply-To: <p6mopi$vc8$1@blaine.gmane.org>
References: <F3D79256-EB69-4092-A958-5F0C9E2AC9AE@blset.com> <p6mopi$vc8$1@blaine.gmane.org>
* 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