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

From David G. Johnston
Subject Re: add function argument name to substring and substr
Date
Msg-id CAKFQuwYSRa_Q-qpXMosT4HYx62aGjkiNA2A-d6dZhzTamHs6dw@mail.gmail.com
Whole thread Raw
In response to Re: add function argument name to substring and substr  (Marcos Pegoraro <marcos@f10.com.br>)
List pgsql-hackers
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.

Was pondering explaining the "no parentheses" case here; but for someone familiar with PREs the behavior is obvious and everyone else has the link needed to learn what is happening.

David J.

pgsql-hackers by date:

Previous
From: Matthias van de Meent
Date:
Subject: Re: Adding skip scan (including MDAM style range skip scan) to nbtree
Next
From: Shlok Kyal
Date:
Subject: Re: Restrict publishing of partitioned table with a foreign table as partition