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 1p0s7v-0000m7-Uk for pgsql-hackers@arkaria.postgresql.org; Thu, 01 Dec 2022 22:33:55 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1p0s7t-0006el-4F for pgsql-hackers@arkaria.postgresql.org; Thu, 01 Dec 2022 22:33:53 +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 1p0s7s-0006ea-RF for pgsql-hackers@lists.postgresql.org; Thu, 01 Dec 2022 22:33:52 +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 1p0s7p-0000ku-11 for pgsql-hackers@lists.postgresql.org; Thu, 01 Dec 2022 22:33:50 +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 2B1MXjrQ1721520; Thu, 1 Dec 2022 17:33:45 -0500 From: Tom Lane To: Robert Haas cc: Andrew Dunstan , Corey Huinker , Nikita Glukhov , PostgreSQL Hackers Subject: Re: Error-safe user functions In-reply-to: References: <3bbbb0df-7382-bf87-9737-340ba096e034@postgrespro.ru> <3190059.1665164276@sss.pgh.pa.us> <57b7cc2e-1215-3f43-84e4-6d9f8ad575df@dunslane.net> <3049337.1669008405@sss.pgh.pa.us> <469338a3-da38-160f-23b9-813c261bc1d6@dunslane.net> <1677334.1669918475@sss.pgh.pa.us> <1695760.1669923671@sss.pgh.pa.us> <1703871.1669927782@sss.pgh.pa.us> Comments: In-reply-to Robert Haas message dated "Thu, 01 Dec 2022 16:15:17 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1721518.1669934025.1@sss.pgh.pa.us> Date: Thu, 01 Dec 2022 17:33:45 -0500 Message-ID: <1721519.1669934025@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Robert Haas writes: > It sounds to me like we're crafting something that is specific to and > can only be used with type input and output functions, so the name > probably should reflect that rather than being something totally > generic like ereturn() or error_stash() or whatever. My opinion is exactly the opposite. Don't we already have a need for error-safe type conversions, too, in the JSON stuff? Even if I couldn't point to a need-it-now requirement, I think we will eventually find a use for this with some other classes of functions. > If we were making > this into a general-purpose way of sticking an error someplace, then a > name like that would make sense and this would be an extension of the > elog.c interface. But what you're proposing is a great deal more > specialized than that. I'm proposing *exactly* an extension of the elog.c interface; so were you, a couple messages back. It's only specialized to I/O in the sense that our current need is for that. regards, tom lane