Re: Suggestion for docs, section "4.2.3 Subscripts": bounds and base - Mailing list pgsql-docs

From David G. Johnston
Subject Re: Suggestion for docs, section "4.2.3 Subscripts": bounds and base
Date
Msg-id CAKFQuwYNv_Z4Hiu0w8DHxDpqN8Ek2aNF3ZBgy2Zbx6hy2-uMPw@mail.gmail.com
Whole thread Raw
In response to Suggestion for docs, section "4.2.3 Subscripts": bounds and base  (PG Doc comments form <noreply@postgresql.org>)
List pgsql-docs
On Thursday, April 3, 2025, PG Doc comments form <noreply@postgresql.org> wrote:
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?

The answers depend on the data type to which the [ ] operation is being applied.  And we haven’t really covered data type at this point.  So probably we should just acknowledge these nuances exist and say you can find the answers for a given data type in its reference page.  As a reader, then, it is registered as an unimportant detail within the overall learning of the grammar.  (I’ll have a more precise answer when I have a moment to re-read these docs.)

David J.

pgsql-docs by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: generated constraint name
Next
From: Zeyuan Hu
Date:
Subject: Possible documentation inaccuracy in optimizer README