Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m86ik-0007jS-To for pgsql-hackers@arkaria.postgresql.org; Mon, 26 Jul 2021 19:57:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1m86ij-0001SO-GV for pgsql-hackers@arkaria.postgresql.org; Mon, 26 Jul 2021 19:57:01 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m86ij-0001SB-99 for pgsql-hackers@lists.postgresql.org; Mon, 26 Jul 2021 19:57:01 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m86ic-0005Fv-MI for pgsql-hackers@lists.postgresql.org; Mon, 26 Jul 2021 19:57:00 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 16QJu19I212636; Mon, 26 Jul 2021 15:56:01 -0400 From: Tom Lane To: Gilles Darold cc: Chapman Flack , Gilles Darold , er@xs4all.nl, pgsql-hackers@lists.postgresql.org Subject: Re: [PATCH] proposal for regexp_count, regexp_instr, regexp_substr and regexp_replace In-reply-to: <45fe2893-1efc-1666-3ea5-b5fb1918c7fa@gmail.com> References: <2292303d-766d-2172-2942-b076a3bb6505@darold.net> <2122577845.234888.1616324857283@webmailclassic.xs4all.nl> <9f91e4e7-19c8-d8e0-6955-fefaebd4c8fe@darold.net> <60575B5A.4080807@anastigmatix.net> <345476.1616338397@sss.pgh.pa.us> <45fe2893-1efc-1666-3ea5-b5fb1918c7fa@gmail.com> Comments: In-reply-to Gilles Darold message dated "Sun, 21 Mar 2021 17:46:47 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <212634.1627329361.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Mon, 26 Jul 2021 15:56:01 -0400 Message-ID: <212635.1627329361@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Gilles Darold writes: > [ v4-0001-regexp-foo-functions.patch ] I started to work through this and was distressed to realize that it's trying to redefine regexp_replace() in an incompatible way. We already have regression=3D# \df regexp_replace List of functions Schema | Name | Result data type | Argument data types |= Type = ------------+----------------+------------------+------------------------+= ------ pg_catalog | regexp_replace | text | text, text, text |= func pg_catalog | regexp_replace | text | text, text, text, text |= func (2 rows) The patch proposes to add (among other alternatives) +{ oid =3D> '9608', descr =3D> 'replace text using regexp', + proname =3D> 'regexp_replace', prorettype =3D> 'text', + proargtypes =3D> 'text text text int4', prosrc =3D> 'textregexreplace_e= xtended_no_occurrence' }, which is going to be impossibly confusing for both humans and machines. I don't think we should go there. Even if you managed to construct examples that didn't result in "ambiguous function" failures, that doesn't mean that ordinary mortals won't get bit that way. I'm inclined to just drop the regexp_replace additions. I don't think that the extra parameters Oracle provides here are especially useful. They're definitely not useful enough to justify creating compatibility hazards for. regards, tom lane