Re: jsonb_array_elements_recursive() - Mailing list pgsql-hackers

From Zhihong Yu
Subject Re: jsonb_array_elements_recursive()
Date
Msg-id CALNJ-vQ-eZLC9-SYd1MnHoTp=_pRgn2TXkQJMA1oV0A9h6tQWw@mail.gmail.com
Whole thread Raw
In response to Re: jsonb_array_elements_recursive()  ("Joel Jacobson" <joel@compiler.org>)
Responses Re: jsonb_array_elements_recursive()
Re: jsonb_array_elements_recursive()
Re: jsonb_array_elements_recursive()
List pgsql-hackers
Hi,
# SELECT '[[5,2],"a",[8,[3,2],6]]'::jsonb;
             jsonb
-------------------------------
 [[5, 2], "a", [8, [3, 2], 6]]
(1 row)

unnest(array[[3,2],"a",[1,4]]) is not accepted currently.

Would the enhanced unnest accept the above array ?

Cheers

On Sun, Feb 7, 2021 at 8:31 AM Joel Jacobson <joel@compiler.org> wrote:
On Sun, Feb 7, 2021, at 17:27, Tom Lane wrote:
>"Joel Jacobson" <joel@compiler.org> writes:
>> Having thought about this some more,
>> the function name should of course be jsonb_unnest(),
>> similar to how unnest() works for normal arrays:
>
>Why not just unnest(), then?
>
>regards, tom lane

Ahh, of course! I totally forgot about function overloading when thinking about this.

+1

/Joel

pgsql-hackers by date:

Previous
From: "Joel Jacobson"
Date:
Subject: Re: jsonb_array_elements_recursive()
Next
From: Pavel Stehule
Date:
Subject: Re: jsonb_array_elements_recursive()