Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tzcnx-004Qc3-Sy for pgsql-hackers@arkaria.postgresql.org; Tue, 01 Apr 2025 14:41:30 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tzcnw-003Okf-Kl for pgsql-hackers@arkaria.postgresql.org; Tue, 01 Apr 2025 14:41:28 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tzcnw-003OjL-Az for pgsql-hackers@lists.postgresql.org; Tue, 01 Apr 2025 14:41:28 +0000 Received: from mail-oa1-x36.google.com ([2001:4860:4864:20::36]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tzcnu-002lov-0W for pgsql-hackers@postgresql.org; Tue, 01 Apr 2025 14:41:27 +0000 Received: by mail-oa1-x36.google.com with SMTP id 586e51a60fabf-2c77a5747e0so3287567fac.2 for ; Tue, 01 Apr 2025 07:41:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1743518484; x=1744123284; darn=postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=A0uIGrvxAzwCEpHSumJFIiByinceLH6iV5QbVbSMeW8=; b=Z/sJ0wfiOKbolIPxO/AIzzhFXpTiJP/BY4XY23BxwBbpVfOP8hlvXelDZpIeevosKY NrWBPoN1JsGu8da1ivrztz8rjAMW0r0Pv6UXUD6tY3s9bKY6swaJsiuCHI+4ABlQUVJT ds94hfC9d8Rm0qtJ5vx0vR8nOff3atw0T3NuHB4mvjpcJx8GerPwqDmGoJdvY5Y2D9Qp 3TTXgozN/hRM32HgImsEUJmCR1Zp/jvlRAz01NWYuOVppv6BdRtXUf4QiIS+Ywl3VPPo 1VYOJIS9rETxuF/amK9bhN7KWfh9eRvph+/wyKssvqnQ+SbBdlbPwnTt0KnQPPdpDxCw 4a+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743518484; x=1744123284; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=A0uIGrvxAzwCEpHSumJFIiByinceLH6iV5QbVbSMeW8=; b=BBhhDAzKstbw7GQug4ITutitXQQ42haVJX3brFP6Zsy3UUcsmn/Lwy5tqWHOI6Tm/p YMJAO+ecaotaswJg9YjgEmGlbkSSWQGhFT6XUCfrNnkxyAlQed5qveaXP62zMKYmC/BS gA337CMcLVM8z7qca7mAwwQc5yM5iRtt5IdRdxMlRE1r7pAqSp7m0uMgLAnF/duxa7fJ KbYHPzR3dqQTmTU7fY3Opt1Ob7IF1vuBr6a+kymr4Bqoty8hprUWi+s2+L5JLhwHvR7J GQPXOUNPBmhh9e8HTsiri/swbPDcZah01WaX8WSpRw1jZponCTa2hbrAlvMyTKQLR6rU 27Ww== X-Forwarded-Encrypted: i=1; AJvYcCVTbyu4VQI1GSpFa90++RR8OEQUtRmxa0xJyRn1udedkFjKloyYKhzkhVyR+ZD+Ngi9bxWCcAnIYdroLO9l@postgresql.org X-Gm-Message-State: AOJu0Yw9gwWM0ORMgxlt9/viVWktfGVaqwXgJ14lH81PP5Lbouwdl+1t p7Fh9OKmZ9JqdvQOx/bFjUoCUYfKeG22t39Vwrz6c3WZ2pI6Wzd7E/lEJGKTyFTLCqrFqiVyZxQ S9/LiXK5v8wMPt0BMkor4hm3gfs4= X-Gm-Gg: ASbGnculQZcQjiJQDVq5QOZKAkOkdAoNq3fybOi9f9FmjFZELi32RNaMWJV2RUOrnyv iN67WEGdR5Zf/oDWT0Pip3AQqyYox3eTj3gimZyakoxqhyu4N7UZv+bHJpDPeQ5oCM5Ow3HWIet jFgJzqQ3gL8VkF3lZLm0tAK0eB X-Google-Smtp-Source: AGHT+IFo2Iljtp6+HsMfRED8jUTNSPF5k0HxJWWvVVVJvuX9ehQ+ooKWHb9oibqRJV4+kJuaZWoeZISUcSRjFjCyzBg= X-Received: by 2002:a05:6871:7c0b:b0:2c2:30ca:8da1 with SMTP id 586e51a60fabf-2cbcf583396mr7080397fac.17.1743518484108; Tue, 01 Apr 2025 07:41:24 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: "David G. Johnston" Date: Tue, 1 Apr 2025 07:40:44 -0700 X-Gm-Features: AQ5f1Jo193MWu85L-siCCeegMm0O8kflmr1XPlv8ZTz7EA4QtvjvSMoyoU91k-0 Message-ID: Subject: Re: add function argument name to substring and substr To: Marcos Pegoraro Cc: jian he , PostgreSQL-development Content-Type: multipart/alternative; boundary="000000000000e79dcb0631b887ae" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000e79dcb0631b887ae Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Apr 1, 2025 at 6:15=E2=80=AFAM Marcos Pegoraro = wrote: > Em ter., 1 de abr. de 2025 =C3=A0s 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 > substring('Thomas', '...$') > + substring('Email: johnjohn@mymail.com, Name: John' from > '@(.*), Name') > > 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. --000000000000e79dcb0631b887ae Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Tue, Apr 1, 2025 at 6:15=E2=80=AFAM Marcos Pegoraro <= ;marcos@f10.com.br> wrote:
Em = ter., 1 de abr. de 2025 =C3=A0s 02:00, David G. Johnston <david.g.johnston@gmail.co= m> escreveu:

Wouldn't i= t be good to add the use of parentheses using posix ? It's useful and r= arely documented
=C2=A0 =C2=A0 =C2=A0 =C2=A0 <literal>substring('T= homas', '...$')</literal>
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0<= ;literal>substring('Email: johnjohn@mymail.com, Name: John' from '@(.*), N= ame')</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 everyo= ne else has the link needed to learn what is happening.

<= div class=3D"gmail_default" style=3D"font-family:arial,helvetica,sans-serif= ">David J.

--000000000000e79dcb0631b887ae--