> On 12 Nov 2021, at 13:18, PG Doc comments form <nore...@postgresql.org> wrote:

> Maybe this example for json_array_elements is wrong?

No, the example works as intended and yields the output in the documentation:

postgres=# select * from json_array_elements('[1,true, [2,false]]');
   value
-----------
 1
 true
 [2,false]
(3 rows)

Your proposal is also syntactically correct, but it's not what the author
intended when writing the example:

postgres=# select * from json_array_elements('[[1,true], [2,false]]');
   value
-----------
 [1,true]
 [2,false]
(2 rows)

--
Daniel Gustafsson               https://vmware.com/



Reply via email to