Re: add function argument name to substring and substr

2025-11-09 Thread jian he
On Tue, Oct 14, 2025 at 12:11 AM Tom Lane wrote: > > Andrew Dunstan writes: > > 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. > > +1 for t

Re: add function argument name to substring and substr

2025-10-18 Thread jian he
On Mon, Oct 13, 2025 at 10:58 PM Andrew Dunstan 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

Re: add function argument name to substring and substr

2025-10-18 Thread Andrew Dunstan
On 2025-10-13 Mo 10:22 AM, jian he wrote: On Mon, Jul 21, 2025 at 2:31 PM jian he wrote: 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 su

Re: add function argument name to substring and substr

2025-10-18 Thread jian he
On Mon, Jul 21, 2025 at 2:31 PM jian he wrote: > > 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 m

Re: add function argument name to substring and substr

2025-10-18 Thread Tom Lane
Andrew Dunstan writes: > 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. +1 for that idea. As Jian notes, we'd need to make the docs match, b

Re: add function argument name to substring and substr

2025-10-14 Thread jian he
On Tue, Oct 14, 2025 at 12:11 AM Tom Lane wrote: > > Andrew Dunstan writes: > > 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. > > +1 for t

Re: add function argument name to substring and substr

2025-07-20 Thread jian he
On Tue, Apr 1, 2025 at 10:41 PM David G. Johnston wrote: > > On Tue, Apr 1, 2025 at 6:15 AM Marcos Pegoraro wrote: >> >> Em ter., 1 de abr. de 2025 às 02:00, David G. Johnston >> escreveu: >> >> Wouldn't it be good to add the use of parentheses using posix ? It's useful >> and rarely documente

Re: add function argument name to substring and substr

2025-04-01 Thread Daniel Gustafsson
> On 1 Apr 2025, at 15:14, Marcos Pegoraro wrote: > > Em ter., 1 de abr. de 2025 às 02:00, David G. Johnston > escreveu: > > Wouldn't it be good to add the use of parentheses using posix ? It's useful > and rarely documented > substring('Thomas', '...$') > +substring('Email: j

Re: add function argument name to substring and substr

2025-04-01 Thread Marcos Pegoraro
Em ter., 1 de abr. de 2025 às 02:00, David G. Johnston < [email protected]> escreveu: Wouldn't it be good to add the use of parentheses using posix ? It's useful and rarely documented substring('Thomas', '...$') +substring('Email: [email protected], Name: John' from '@(.

Re: add function argument name to substring and substr

2025-04-01 Thread David G. Johnston
On Tue, Apr 1, 2025 at 6:15 AM Marcos Pegoraro wrote: > Em ter., 1 de abr. de 2025 às 02:00, David G. Johnston < > [email protected]> escreveu: > > Wouldn't it be good to add the use of parentheses using posix ? It's > useful and rarely documented > substring('Thomas', '...$') >

Re: add function argument name to substring and substr

2025-03-31 Thread David G. Johnston
On Mon, Mar 31, 2025 at 9:12 PM jian he wrote: > On Tue, Apr 1, 2025 at 6:22 AM David G. Johnston > wrote: > > > > On Tue, Mar 18, 2025 at 9:04 PM jian he > wrote: > >> > >> > >> new patch attached. > >> > > > > I've done v4 with a delta patch. > > your v4-0001-v3-0001-substring.patch is not th

Re: add function argument name to substring and substr

2025-03-31 Thread jian he
On Tue, Apr 1, 2025 at 6:22 AM David G. Johnston wrote: > > On Tue, Mar 18, 2025 at 9:04 PM jian he wrote: >> >> >> new patch attached. >> > > I've done v4 with a delta patch. > > Decided to standardize on calling the SQL Similar To regular expression > escape replaceable "escape" everywhere. >

Re: add function argument name to substring and substr

2025-03-31 Thread David G. Johnston
On Tue, Mar 18, 2025 at 9:04 PM jian he wrote: > > new patch attached. > > I've done v4 with a delta patch. Decided to standardize on calling the SQL Similar To regular expression escape replaceable "escape" everywhere. Instead of fully documenting the obsolete syntax I added a note explaining

Re: add function argument name to substring and substr

2025-03-18 Thread jian he
hi. new patch attached. now \df substring looks like: List of functions Schema | Name| Result data type | Argument data types| Type +---+--+---

Re: add function argument name to substring and substr

2025-03-18 Thread David G. Johnston
On Tue, Mar 18, 2025 at 6:20 PM jian he wrote: > On Wed, Mar 19, 2025 at 8:19 AM David G. Johnston > wrote: > > > > The vast majority of examples throughout the manual use traditional > function call syntax func_name(arg1, arg2, etc.); I'd rather keep with > convention than start to scatter ab

Re: add function argument name to substring and substr

2025-03-18 Thread jian he
On Wed, Mar 19, 2025 at 8:19 AM David G. Johnston wrote: > > The vast majority of examples throughout the manual use traditional function > call syntax func_name(arg1, arg2, etc.); I'd rather keep with convention > than start to scatter about alternative syntax choices just to give the > rand

Re: add function argument name to substring and substr

2025-03-18 Thread David G. Johnston
On Mon, Mar 17, 2025 at 8:20 PM jian he wrote: > On Tue, Feb 18, 2025 at 6:13 AM David G. Johnston > wrote: > > > > Table 9.9 limits itself to those functions defined in the SQL standard; > which are basically the ones that use keywords instead of commas. > > > > The substring(string, start, cou

Re: add function argument name to substring and substr

2025-03-18 Thread jian he
On Tue, Feb 18, 2025 at 6:13 AM David G. Johnston wrote: > > Table 9.9 limits itself to those functions defined in the SQL standard; which > are basically the ones that use keywords instead of commas. > > The substring(string, start, count) function you note is already covered in > Table 9.10 bu

Re: add function argument name to substring and substr

2025-03-16 Thread vignesh C
On Mon, 27 Jan 2025 at 07:51, jian he wrote: > > hi. > > I forgot to attach the patch. > here we are. I noticed that David's comments from [1] have not yet been addressed, I have changed the status of commitfest entry to "Waiting on Author", please address them and change the status to "Needs rev

Re: add function argument name to substring and substr

2025-02-17 Thread David G. Johnston
On Tue, Jan 21, 2025 at 11:21 PM jian he wrote: > hi. > > attached patch add function argument name to function substring and substr > you can see the visual changes. > mater behavior: > > \df substring > List of functions >Schema | Name| Result data type

Re: add function argument name to substring and substr

2025-01-26 Thread jian he
hi. I forgot to attach the patch. here we are. From 249a083627b0d8ad15c698601f7b7649be5262a1 Mon Sep 17 00:00:00 2001 From: jian he Date: Wed, 22 Jan 2025 14:19:15 +0800 Subject: [PATCH v1 1/1] add function argument name to function substring and substr --- src/backend/catalog/system_functions