Re: [Minor] Possible missing syntax

From: Matemática A3K <matematica(dot)a3k(at)gmail(dot)com>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: "pgsql-docs(at)lists(dot)postgresql(dot)org" <pgsql-docs(at)lists(dot)postgresql(dot)org>
Subject: Re: [Minor] Possible missing syntax
Date: 2026-10-19 12:49:07
Message-ID: CA+FDnhJKkcb+m5ZAvFY0j69_ghKpbOfnBXwFyghkanx_jS-oSA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-docs

> 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?

In response to

Browse pgsql-docs by date

  From Date Subject
Next Message Matemática A3K 2026-10-20 15:40:40 [Minor] Improvement on random functions doc
Previous Message Matemática A3K 2026-10-19 12:08:48 Re: Fixes for create subscription page