Re: jsonb_object() seems to be buggy. jsonb_build_object() is good. - Mailing list pgsql-hackers

From David G. Johnston
Subject Re: jsonb_object() seems to be buggy. jsonb_build_object() is good.
Date
Msg-id CAKFQuwa97NgrVKPdLZMKAffZyit-bZ+YrdhwTUMz3im8Spmi5w@mail.gmail.com
Whole thread Raw
In response to Re: jsonb_object() seems to be buggy. jsonb_build_object() is good.  (Bryn Llewellyn <bryn@yugabyte.com>)
List pgsql-hackers
On Friday, February 14, 2020, Bryn Llewellyn <bryn@yugabyte.com> wrote:
The doc (“Builds a JSON object out of a text array.”) is simply too terse to inform an answer to this question.

It does presume knowledge but it precisely defines the outcome:

PostgreSQL arrays are typed and all members are of the same type.  A text array’s members are all text.

Given the above knowledge the fact that the resultant json object contains exclusively text keys and text values directly follows.

David J.

pgsql-hackers by date:

Previous
From: Vik Fearing
Date:
Subject: Re: jsonb_object() seems to be buggy. jsonb_build_object() is good.
Next
From: "David G. Johnston"
Date:
Subject: Re: jsonb_object() seems to be buggy. jsonb_build_object() is good.