Re: substring start position behavior

2024-03-26 Thread Bruce Momjian
On Tue, Mar 26, 2024 at 11:07:07AM -0400, Bruce Momjian wrote: > On Wed, Mar 6, 2024 at 12:42:09AM -0500, Tom Lane wrote: > > I'm kind of inclined to not document this weirdness. I especially > > don't think it's worth giving an example that neither explains the > > "disregarded" bit nor

Re: substring start position behavior

2024-03-26 Thread Bruce Momjian
On Wed, Mar 6, 2024 at 12:42:09AM -0500, Tom Lane wrote: > I'm kind of inclined to not document this weirdness. I especially > don't think it's worth giving an example that neither explains the > "disregarded" bit nor highlights the dependency on L being given. I retract my doc patch for this.

Re: substring start position behavior

2024-03-06 Thread dansonlinepresence
Thanks for all that context and diff! The odd behavior is indeed in the SQL spec. At least I was convinced of that on postgres IRC by someone who seemed to have quoted from the spec. I don't think the feature ought to be hidden because it's odd. If I may suggest some specificity to the wording

Re: substring start position behavior

2024-03-05 Thread Tom Lane
Bruce Momjian writes: > This web page explains the feature: > > https://stackoverflow.com/questions/33462061/sql-server-substring-position-negative-value > but also asks: > now the only question that remains is, "why would anyone need it > to behave this way?" Yeah. I believe

Re: substring start position behavior

2024-03-05 Thread Bruce Momjian
On Tue, Mar 5, 2024 at 09:47:54PM -0500, dansonlineprese...@gmail.com wrote: > Thanks for all that context and diff! The odd behavior is indeed in > the SQL spec. At least I was convinced of that on postgres IRC by > someone who seemed to have quoted from the spec. I don't think the > feature

Re: substring start position behavior

2024-03-05 Thread Bruce Momjian
On Tue, Feb 27, 2024 at 05:20:23PM +, PG Doc comments form wrote: > 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

Re: substring start position behavior

2024-02-27 Thread Jelte Fennema-Nio
On Tue, 27 Feb 2024 at 19:01, PG Doc comments form wrote: > 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). A patch that adds an example of a negative