Re: 8.14.5 jsonb subscripting

Поиск
Список
Период
Сортировка
От Laurenz Albe
Тема Re: 8.14.5 jsonb subscripting
Дата
Msg-id e1b66e9d49654e1609107ac89b71c29be7c0014d.camel@cybertec.at
обсуждение исходный текст
Ответ на 8.14.5 jsonb subscripting  (PG Doc comments form <noreply@postgresql.org>)
Ответы Re: 8.14.5 jsonb subscripting
Список pgsql-docs
On Tue, 2024-04-09 at 09:31 +0000, PG Doc comments form wrote:
> Page: https://www.postgresql.org/docs/16/datatype-json.html
>
> Using subscripts with square brackets is not supported, one must use -> or
> #> operators
> The given examples result in error:
>
> SELECT ('{"a": 1}'::jsonb)['a'];
>
> -- Extract nested object value by key path
> SELECT ('{"a": {"b": {"c": 1}}}'::jsonb)['a']['b']['c'];
>
> -- Extract array element by index
> SELECT ('[1, "2", null]'::jsonb)[1];

You must be using an old PostgreSQL version where that is not yet supported.

Yours,
Laurenz Albe



В списке pgsql-docs по дате отправления:

Предыдущее
От: PG Doc comments form
Дата:
Сообщение: 8.14.5 jsonb subscripting
Следующее
От: Arne Sommerfelt
Дата:
Сообщение: Re: 8.14.5 jsonb subscripting