BUMP! :)

David - or anyone,
Can you review the attached patch with these changes?

Thanks!

On Mon, Oct 19, 2026 at 9:49 AM Matemática A3K <[email protected]> wrote:
>
> > After fixing, this "reads right":
> >
> > [{<literal><replaceable>index</replaceable></literal> | 
> > <literal><replaceable>start_index</replaceable> to 
> > <replaceable>end_index</replaceable></literal>}, ...]
> >
> > but it is not clear that the curly braces and the "or" are not part of the 
> > syntax, while the brackets are. How can this be stated? Is this what you 
> > referred with "the accessor requires the brackets where the forms of 
> > subscript did not"?
>
>
> Given the lack of symbols to express this synthetically, I think the
> original way is more readable but not "complete" in description.
>
> A more comprehensive description would be:
> "
> [subscript ...]
>
> Array element accessor. subscript can be given in two forms: index or
> start_index to end_index. The first form returns a single array
> element by its index. The second form returns an array slice by the
> range of indexes, including the elements that correspond to the
> provided start_index and end_index.
>
> Multiple subscripts are supported, provided that they are separated by a 
> comma.
>
> The specified index can be an integer, as well as an expression
> returning a single numeric value, which is automatically cast to
> integer. Index zero corresponds to the first array element. You can
> also use the last keyword to denote the last array element, which is
> useful for handling arrays of unknown length.
>
> Indexes or range of indexes which do not correspond to the array's
> length are silently ignored.
> "
> (note the removed comma from the syntax, only second and fourth
> sentences are new)
>
> Do you think it is better?
diff --git a/doc/src/sgml/json.sgml b/doc/src/sgml/json.sgml
index 8a2aad5935e..b789bec5892 100644
--- a/doc/src/sgml/json.sgml
+++ b/doc/src/sgml/json.sgml
@@ -982,7 +982,7 @@ UPDATE table_name SET jsonb_field[1]['a'] = '1';
      <row>
       <entry>
        <para>
-        <literal>[<replaceable>subscript</replaceable>, ...]</literal>
+        <literal>[<replaceable>subscript</replaceable> ...]</literal>
        </para>
       </entry>
       <entry>
@@ -996,6 +996,10 @@ UPDATE table_name SET jsonb_field[1]['a'] = '1';
         elements that correspond to the provided
         <replaceable>start_index</replaceable> and <replaceable>end_index</replaceable>.
        </para>
+       <para>
+        Multiple <literal><replaceable>subscript</replaceable></literal>s are supported,
+        provided that they are separated by a comma.
+       </para>
        <para>
         The specified <replaceable>index</replaceable> can be an integer, as
         well as an expression returning a single numeric value, which is
@@ -1004,6 +1008,10 @@ UPDATE table_name SET jsonb_field[1]['a'] = '1';
         to denote the last array element, which is useful for handling arrays
         of unknown length.
        </para>
+       <para>
+       Indexes or range of indexes which do not correspond to the array's
+       length are silently ignored.
+       </para>
       </entry>
      </row>
      <row>

Reply via email to