Re: Why does jsonb_set() remove non-mentioned keys?

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: Why does jsonb_set() remove non-mentioned keys?
Дата
Msg-id CAKFQuwZWLNHw1=srVwe3c2X+5jjGOxv0rfaa9RuLk_Tu8zx8Hg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Why does jsonb_set() remove non-mentioned keys?  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-general
On Thu, Jul 4, 2019 at 2:09 PM David G. Johnston <david.g.johnston@gmail.com> wrote:
On Thursday, July 4, 2019, Gianni Ceccarelli <dakkar@thenautilus.net> wrote:

> select to_jsonb('null'::text);
┌──────────┐
│ to_jsonb │
├──────────┤
│ "null"   │
└──────────┘


Json null


Sorry, my bad on this last one.  You cannot use to_jsonb to construct a json null.  The only way, I think, to construct a json null scalar is with an explicit literal.

SELECT 'null'::jsonb;

The to_jsonb function always interprets a textual value passed to it as being the literal text and so the original query results in a json string whose content is "null"

David J.

В списке pgsql-general по дате отправления:

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: Converting to identity columns with domains on PK columns
Следующее
От: Laurenz Albe
Дата:
Сообщение: Re: Converting to identity columns with domains on PK columns