Re: substring synopsis section, third argument is optional doc didn't show that - Mailing list pgsql-docs

From David G. Johnston
Subject Re: substring synopsis section, third argument is optional doc didn't show that
Date
Msg-id CAKFQuwbiPN2pVd_xLp735ouoncOqtR3cHdX4QEpcfbq_=ho=CQ@mail.gmail.com
Whole thread Raw
Responses Re: substring synopsis section, third argument is optional doc didn't show that
List pgsql-docs
On Tue, Jan 21, 2025 at 11:29 PM jian he <jian.universality@gmail.com> wrote:
in 9.7.2 do you think it's worthwhile changing it to
""
As with SIMILAR TO, substring(string, pattern, escape-character)
the specified pattern must match the entire data string, or else the
function fails and returns null.
""
?


Making reference to any one of the three listed function signatures here doesn't seem to provide value.  If anything I'd write:

"As with SIMILAR TO, substring matches the specified pattern to the entire data string, returning null otherwise."

I would avoid saying that the function fails in any situation that doesn't produce an actual error.  The transition of "match everything or returns null" can be bike-shedded though.

David J.

pgsql-docs by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: Improve examples: Provide the example which extend to the left of the range
Next
From: "David G. Johnston"
Date:
Subject: Re: Logical replication - initial data synchronization