Re: jsonb_object() seems to be buggy. jsonb_build_object() is good.

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: jsonb_object() seems to be buggy. jsonb_build_object() is good.
Дата
Msg-id CAKFQuwY2pywNG8S2bHEzFBeEzDkw=ziUbsw9KhS_cPc7FYPGGQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: jsonb_object() seems to be buggy. jsonb_build_object() is good.  (Bryn Llewellyn <bryn@yugabyte.com>)
Ответы Re: jsonb_object() seems to be buggy. jsonb_build_object() is good.  (Bryn Llewellyn <bryn@yugabyte.com>)
Список pgsql-hackers
On Friday, February 14, 2020, Bryn Llewellyn <bryn@yugabyte.com> wrote:

select jsonb_pretty(jsonb_object(
 '{a, 17, b, "dog", c, true}'::varchar[]
 ))

In other words, do the double quotes around "dog" have no effect? That would be a bad thing—and it would limit the usefulness of the jsonb_object() function.

The double quotes serve a specific purpose, to allow values containing commas to be treated as a single value (see syntax details for the exact rules) in the resulting array of text values.  The fact you don’t have to quote the other strings is a convenience behavior of the feature.

David J.

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

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Re: jsonb_object() seems to be buggy. jsonb_build_object() is good.
Следующее
От: Amit Kapila
Дата:
Сообщение: Re: Parallel copy