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 1p2wGo-0008Bd-NA for pgsql-hackers@arkaria.postgresql.org; Wed, 07 Dec 2022 15:23:38 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1p2wGl-0008Sm-ON for pgsql-hackers@arkaria.postgresql.org; Wed, 07 Dec 2022 15:23:35 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p2wGl-0008P3-Ez for pgsql-hackers@lists.postgresql.org; Wed, 07 Dec 2022 15:23:35 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p2wGf-0002g9-4V for pgsql-hackers@lists.postgresql.org; Wed, 07 Dec 2022 15:23:31 +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 2B7FNMnP4026790; Wed, 7 Dec 2022 10:23:22 -0500 From: Tom Lane To: Andrew Dunstan cc: Corey Huinker , Andres Freund , Alvaro Herrera , Joe Conway , Robert Haas , Nikita Glukhov , PostgreSQL Hackers Subject: Re: Error-safe user functions In-reply-to: <6acddf68-7cb7-e9e7-a5a7-0abc87b3c55b@dunslane.net> 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> <20221206005607.lxcrazckoalptwds@alap3.anarazel.de> <3523582.1670288815@sss.pgh.pa.us> <40ff1ed1-4245-e343-bffa-c7755b031492@dunslane.net> <3889877.1670358069@sss.pgh.pa.us> <4009543.1670422833@sss.pgh.pa.us> <6acddf68-7cb7-e9e7-a5a7-0abc87b3c55b@dunslane.net> Comments: In-reply-to Andrew Dunstan message dated "Wed, 07 Dec 2022 10:04:01 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <4026788.1670426602.1@sss.pgh.pa.us> Date: Wed, 07 Dec 2022 10:23:22 -0500 Message-ID: <4026789.1670426602@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Andrew Dunstan writes: > On 2022-12-07 We 09:20, Tom Lane wrote: >> Returning to the naming quagmire -- it occurred to me just now that >> it might be helpful to call this style of error reporting "soft" >> errors rather than "safe" errors, which'd provide a nice contrast >> with "hard" errors thrown by longjmp'ing. That would lead to naming >> all the variant functions XXXSoft not XXXSafe. > I'm not sure InputFunctionCallSoft would be an improvement. Yeah, after reflecting on it a bit more I'm not that impressed with that as a function name either. (I think that "soft error" could be useful as informal terminology. AFAIR we don't use "hard error" in any formal way either, but there are certainly comments using that phrase.) More questions: * Anyone want to bikeshed about the new SQL-level function names? I'm reasonably satisfied with "pg_input_is_valid" for the bool-returning variant, but not so much with "pg_input_invalid_message" for the error-message-returning variant. Thinking about "pg_input_error_message" instead, but that's not stellar either. * Where in the world shall we document these, if we document them? The only section of chapter 9 that seems even a little bit appropriate is "9.26. System Information Functions and Operators", and even there, they would need their own new table because they don't fit well in any existing table. BTW, does anyone else agree that 9.26 is desperately in need of some subdivisions? It seems to have gotten a lot longer since I looked at it last. regards, tom lane