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 1p8EnL-0005Hr-Sr for pgsql-hackers@arkaria.postgresql.org; Thu, 22 Dec 2022 06:11:07 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1p8EnK-0008HC-Ot for pgsql-hackers@arkaria.postgresql.org; Thu, 22 Dec 2022 06:11:06 +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 1p8EnK-0008Gz-G3 for pgsql-hackers@lists.postgresql.org; Thu, 22 Dec 2022 06:11:06 +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 1p8EnG-0000OS-0z for pgsql-hackers@lists.postgresql.org; Thu, 22 Dec 2022 06:11:06 +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 2BM6AsTE1815582; Thu, 22 Dec 2022 01:10:55 -0500 From: Tom Lane To: Andrew Dunstan cc: Amul Sul , Andres Freund , Alexander Korotkov , Robert Haas , "David G. Johnston" , Corey Huinker , Alvaro Herrera , Joe Conway , Nikita Glukhov , PostgreSQL Hackers Subject: Re: Error-safe user functions In-reply-to: <0a001cdd-12c9-813d-a8f6-92a8ac48fc80@dunslane.net> References: <4009543.1670422833@sss.pgh.pa.us> <20221208215836.3naznqmal2m32hzc@awork3.anarazel.de> <512551.1670540229@sss.pgh.pa.us> <20221209023351.l362yejerfoq3lfp@awork3.anarazel.de> <633426.1670554790@sss.pgh.pa.us> <01ff2051-806d-af2f-4f9e-793f7ba9a3f8@dunslane.net> <778369.1670598993@sss.pgh.pa.us> <5aaf7c66-9df9-21a9-1ff4-02c7848def52@dunslane.net> <3bac9841-fe07-713d-fa42-606c225567d6@dunslane.net> <1436686.1670701118@sss.pgh.pa.us> <2b1e7d56-6f37-bad9-9702-053ab55ecf60@dunslane.net> <1805344.1670779451@sss.pgh.pa.us> <1863335.1670783397@sss.pgh.pa.us> <2687377.1671033604@sss.pgh.pa.us> <2966981.1671057469@sss.pgh.pa.us> <0a001cdd-12c9-813d-a8f6-92a8ac48fc80@dunslane.net> Comments: In-reply-to Andrew Dunstan message dated "Wed, 21 Dec 2022 18:19:52 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1815580.1671689454.1@sss.pgh.pa.us> Date: Thu, 22 Dec 2022 01:10:54 -0500 Message-ID: <1815581.1671689454@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Andrew Dunstan writes: > And here's another for contrib/seg > I'm planning to commit these two in the next day or so. I didn't look at the jsonpath one yet. The seg patch passes an eyeball check, with one minor nit: in seg_atof, + *result = float4in_internal(value, NULL, "real", value, escontext); don't we want to use "seg" as the type_name? Even more nitpicky, in +seg_yyerror(SEG *result, struct Node *escontext, const char *message) { + if (SOFT_ERROR_OCCURRED(escontext)) + return; I'd be inclined to add some explanation, say +seg_yyerror(SEG *result, struct Node *escontext, const char *message) { + /* if we already reported an error, don't overwrite it */ + if (SOFT_ERROR_OCCURRED(escontext)) + return; regards, tom lane