Suggestion for docs, section "4.2.3 Subscripts": bounds and base

From: PG Doc comments form <noreply(at)postgresql(dot)org>
To: pgsql-docs(at)lists(dot)postgresql(dot)org
Cc: s(at)xss(dot)de
Subject: Suggestion for docs, section "4.2.3 Subscripts": bounds and base
Date: 2025-04-03 18:22:24
Message-ID: 174370454407.3115968.6902015899222362259@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/17/sql-expressions.html
Description:

I skimmed over section 4.2 while waiting for a meeting to start and found no
mention of the following two questions that immediately pop up in my mind
when subscripts are mentionned:

Are subscripts 0-based or 1-based?
Are slice boundaries inclusive or exclusive?

Suggestion:
...
`expression[subscript]`
where by default the subscript is counted from 1. A contiguous slice of
array elements can be extracted by using the subscript of the first and last
element to be included in the slice:
`expression[first_included_subscript:last_included_subscript]`

Regards,
s.

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message PG Doc comments form 2025-04-06 10:16:30 generated constraint name
Previous Message Pavel Stehule 2025-04-03 15:14:53 Re: Mention the default io_method?