Re: Example of json_array_elements - Mailing list pgsql-docs

From Daniel Gustafsson
Subject Re: Example of json_array_elements
Date
Msg-id 6B42B8C7-A5EB-49AA-8199-D3CBCD3A9C40@yesql.se
Whole thread Raw
In response to Example of json_array_elements  (PG Doc comments form <noreply@postgresql.org>)
List pgsql-docs
> On 12 Nov 2021, at 13:18, PG Doc comments form <noreply@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/




pgsql-docs by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: \dp privileges "decoder" dropped in v12 of docs
Next
From: Tom Lane
Date:
Subject: Re: Ltree pattern matching