Re: Example of json_array_elements

Поиск
Список
Период
Сортировка
От Daniel Gustafsson
Тема Re: Example of json_array_elements
Дата
Msg-id 6B42B8C7-A5EB-49AA-8199-D3CBCD3A9C40@yesql.se
обсуждение исходный текст
Ответ на Example of json_array_elements  (PG Doc comments form <noreply@postgresql.org>)
Список 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 по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: \dp privileges "decoder" dropped in v12 of docs
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Ltree pattern matching