8.14.5 jsonb subscripting

From: PG Doc comments form <noreply(at)postgresql(dot)org>
To: pgsql-docs(at)lists(dot)postgresql(dot)org
Cc: arne(dot)sommerfelt(at)gmail(dot)com
Subject: 8.14.5 jsonb subscripting
Date: 2024-04-09 09:31:40
Message-ID: 171265510066.682.7886492568248508496@wrigleys.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/16/datatype-json.html
Description:

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];

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Rajan Pandey 2024-04-09 10:19:39 Postgres_FDW doc doesn't specify TYPE support in Remote Execution Options
Previous Message Jan Behrens 2024-04-08 12:39:05 Re: Non-blocking synchronization in libpq using pipeline mode