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-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 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