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 1kwIiC-0001hQ-7y for pgsql-hackers@arkaria.postgresql.org; Mon, 04 Jan 2021 05:47:24 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kwIiA-0002G1-Bi for pgsql-hackers@arkaria.postgresql.org; Mon, 04 Jan 2021 05:47:22 +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 1kwIiA-0002Fu-5E for pgsql-hackers@lists.postgresql.org; Mon, 04 Jan 2021 05:47:22 +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 1kwIi7-0000ef-Rv for pgsql-hackers@lists.postgresql.org; Mon, 04 Jan 2021 05:47:21 +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 1045lGo32878373; Mon, 4 Jan 2021 00:47:17 -0500 From: Tom Lane To: Mark Dilger cc: "pgsql-hackers@postgresql.org" Subject: Re: Test harness for regex code (to allow importing Tcl's test suite) In-reply-to: <00A426B2-983A-4996-AF66-C9511B88FFC3@enterprisedb.com> References: <2873268.1609732164@sss.pgh.pa.us> <00A426B2-983A-4996-AF66-C9511B88FFC3@enterprisedb.com> Comments: In-reply-to Mark Dilger message dated "Sun, 03 Jan 2021 21:37:41 -0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2878371.1609739236.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Mon, 04 Jan 2021 00:47:16 -0500 Message-ID: <2878372.1609739236@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Mark Dilger writes: > Have you thought about whether If it weren't in test/modules, it might b= e nice to expose test_regex from SQL with a slightly different interface t= hat doesn't throw on regex compilation error? Maybe something in contrib?= It might be useful to some users to validate regular expressions. I'm j= ust asking... I don't have any problem with how you have it here. Hm. There isn't anything about test_regex()'s API that I would want to expose to end users ;-) ... it's just designed to replicate the test API that Henry Spencer designed a couple decades ago, which IMO was not too clean even by the standards of the time. However, I can see the argument for a function along the lines of "validate_regex(text) returns bool". If you or somebody else wants to write that, independently of this patch, I think it'd be a fine idea. regards, tom lane