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 CACJufxHbWiZLwzKs6k4+w=UjA_wDEEhWgH2fpUexxgvHOP_OWA@mail.gmail.com
Whole thread Raw
In response to Re: add function argument name to substring and substr  ("David G. Johnston" <david.g.johnston@gmail.com>)
List pgsql-hackers
On Tue, Apr 1, 2025 at 10:41 PM David G. Johnston
<david.g.johnston@gmail.com> wrote:
>
> On Tue, Apr 1, 2025 at 6:15 AM Marcos Pegoraro <marcos@f10.com.br> wrote:
>>
>> Em ter., 1 de abr. de 2025 às 02:00, David G. Johnston <david.g.johnston@gmail.com> escreveu:
>>
>> Wouldn't it be good to add the use of parentheses using posix ? It's useful and rarely documented
>>         <literal>substring('Thomas', '...$')</literal>
>> +        <literal>substring('Email: johnjohn@mymail.com, Name: John' from '@(.*), Name')</literal>
>>
>
> Agreed. A second example using () would be good here.
>

actually,
section (9.7.3.)
https://www.postgresql.org/docs/current/functions-matching.html#FUNCTIONS-POSIX-REGEXP
already have example, like:
substring('foobar' from 'o(.)b')

new patch attached, split substr, substring to make review more easier.
v6-0001: add function argument name to function substr
v6-0002: add function argument name to function substring

v6-0002 incorporated some of the changes in v5-0002-v3-delta.patch.
some of the changes in v5-0002-v3-delta.patch are not related to this thread,
so I didn't incorporate them, right now.

Attachment

pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: POC: enable logical decoding when wal_level = 'replica' without a server restart
Next
From: Peter Smith
Date:
Subject: Re: Skipping schema changes in publication