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 1p2eZA-00079O-27 for pgsql-hackers@arkaria.postgresql.org; Tue, 06 Dec 2022 20:29: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 1p2eZ8-0001yf-JD for pgsql-hackers@arkaria.postgresql.org; Tue, 06 Dec 2022 20:29: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 1p2eZ8-0001yW-9v for pgsql-hackers@lists.postgresql.org; Tue, 06 Dec 2022 20:29: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 1p2eZ6-0004HV-7H for pgsql-hackers@lists.postgresql.org; Tue, 06 Dec 2022 20:29: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 2B6KTFFE3891065; Tue, 6 Dec 2022 15:29:15 -0500 From: Tom Lane To: Robert Haas cc: Andrew Dunstan , Andres Freund , Alvaro Herrera , Joe Conway , Corey Huinker , Nikita Glukhov , PostgreSQL Hackers Subject: Re: Error-safe user functions In-reply-to: References: <20221205174231.6wpmbuxafnfzlbuh@alvherre.pgsql> <85e40849-4458-bbb9-62ee-d9e7faf0c7dc@dunslane.net> <3323802.1670263204@sss.pgh.pa.us> <3496391.1670276406@sss.pgh.pa.us> <20221205234734.sab3fuxy6q2sokjd@alap3.anarazel.de> <3518534.1670285891@sss.pgh.pa.us> <3614822.1670337737@sss.pgh.pa.us> <3676101.1670342821@sss.pgh.pa.us> Comments: In-reply-to Robert Haas message dated "Tue, 06 Dec 2022 12:10:09 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3891063.1670358555.1@sss.pgh.pa.us> Date: Tue, 06 Dec 2022 15:29:15 -0500 Message-ID: <3891064.1670358555@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Robert Haas writes: > I feel like this can go either way. If we pick a name that conveys a > specific intended behavior now, and then later we want to pass some > other sort of node for some purpose other than ignoring errors, it's > unpleasant to have a name that sounds like it can only ignore errors. > But if we never use it for anything other than ignoring errors, a > specific name is clearer. With Andres' proposal to make the function return boolean succeed/fail, I think it's pretty clear that the only useful case is to pass an ErrorSaveContext. There may well be future APIs that pass some other kind of context object to input functions, but they'll presumably have different goals and want a different sort of wrapper function. regards, tom lane