Re: add function argument name to substring and substr - Mailing list pgsql-hackers

From jian he
Subject Re: add function argument name to substring and substr
Date
Msg-id CACJufxH3dnnQKRuPNhUtHEUN=XkAGsPmEfMpAW5zo=3CvVbgzQ@mail.gmail.com
Whole thread Raw
In response to Re: add function argument name to substring and substr  (Andrew Dunstan <andrew@dunslane.net>)
List pgsql-hackers
On Mon, Oct 13, 2025 at 10:58 PM Andrew Dunstan <andrew@dunslane.net> wrote:
>
> I'm late to the party on this, but I wonder if it wouldn't be better to
> use a type-neutral parameter name here, like "source", which could cover
> all these cases, instead of "string", "bytes", etc.
>

\df *regexp*

psql output generally begins with "string text, pattern text"
that's because of commit 580f872.

in that commit, discussion,
https://www.postgresql.org/message-id/CACJufxG3NFKKsh6x4fRLv8h3V-HvN4W5dA%3DzNKMxsNcDwOKang%40mail.gmail.com,
in that first patch, i did tried to use "source" in some cases, then I found out
if you changed to "source" then all the documentation also needs to be
changed.  so
I stuck to "string" in commit 580f872.

Here, for the functions substr and substring, I followed the precedent set by
the regex function using the term "string".

sure, we can change it to "source" if that's what people want.



pgsql-hackers by date:

Previous
From: Jim Jones
Date:
Subject: Re: Add notification on BEGIN ATOMIC SQL functions using temp relations
Next
From: Bryan Green
Date:
Subject: [PATCH] Fix incorrect fprintf usage in log_error FRONTEND path