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.