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

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: "s(at)xss(dot)de" <s(at)xss(dot)de>, "pgsql-docs(at)lists(dot)postgresql(dot)org" <pgsql-docs(at)lists(dot)postgresql(dot)org>
Subject: Re: Suggestion for docs, section "4.2.3 Subscripts": bounds and base
Date: 2025-04-07 13:51:41
Message-ID: CAKFQuwYNv_Z4Hiu0w8DHxDpqN8Ek2aNF3ZBgy2Zbx6hy2-uMPw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

On Thursday, April 3, 2025, PG Doc comments form <noreply(at)postgresql(dot)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.

In response to

Browse pgsql-docs by date

  From Date Subject
Next Message Bruce Momjian 2025-04-08 01:34:06 Re: Parameter NOT NULL to CREATE DOMAIN not the same as CHECK (VALUE IS NOT NULL)
Previous Message David G. Johnston 2025-04-07 13:34:38 Re: generated constraint name