substring start position behavior

Поиск
Список
Период
Сортировка
От PG Doc comments form
Тема substring start position behavior
Дата
Msg-id 170905442373.643.11536838320909376197@wrigleys.postgresql.org
обсуждение исходный текст
Ответы Re: substring start position behavior  (Jelte Fennema-Nio <postgres@jeltef.nl>)
Re: substring start position behavior  (Bruce Momjian <bruce@momjian.us>)
Список pgsql-docs
The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/16/functions-string.html
Description:

Hey,

I was confused by substring behavior today, when giving 0 as a start
position. I understand now that string indices are 1-based, have a certain
flexibility about where to start (allowing negative start positions), and
that this is defined in the standard SQL spec.

I'm comfy with all this, but I think it'd be nice to have a hint in the pg
substring docs for nonpositive start positions, so that users don't have to
have paid for the standard SQL spec to get past this. To me, substring seems
like a relatively common function with relatively surprising behavior.

I'd be happy to write up a patch as a next step -- I'm not sure this would
count as a "trivial patch that serves an obvious need"
(https://wiki.postgresql.org/wiki/Submitting_a_Patch). Only thing is, I
can't seem to find the source repo for the docs.
https://www.postgresql.org/docs/current/docguide-toolsets.html mentions a
configure script, but I don't know which one.

Best,
Dan

В списке pgsql-docs по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Typos in dectoint() and dectolong() function's descriptions
Следующее
От: Jelte Fennema-Nio
Дата:
Сообщение: Re: substring start position behavior