Re: add function argument name to substring and substr

From: jian he <jian(dot)universality(at)gmail(dot)com>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: Marcos Pegoraro <marcos(at)f10(dot)com(dot)br>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: add function argument name to substring and substr
Date: 2025-07-21 06:31:45
Message-ID: CACJufxHbWiZLwzKs6k4+w=UjA_wDEEhWgH2fpUexxgvHOP_OWA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Apr 1, 2025 at 10:41 PM David G. Johnston
<david(dot)g(dot)johnston(at)gmail(dot)com> wrote:
>
> On Tue, Apr 1, 2025 at 6:15 AM Marcos Pegoraro <marcos(at)f10(dot)com(dot)br> wrote:
>>
>> Em ter., 1 de abr. de 2025 às 02:00, David G. Johnston <david(dot)g(dot)johnston(at)gmail(dot)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(at)mymail(dot)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 Content-Type Size
v6-0001-add-function-argument-name-to-substr.patch text/x-patch 3.1 KB
v6-0002-add-function-argument-name-to-function-substring.patch text/x-patch 12.3 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Smith 2025-07-21 06:46:48 Re: Skipping schema changes in publication
Previous Message Amit Kapila 2025-07-21 06:28:05 Re: POC: enable logical decoding when wal_level = 'replica' without a server restart