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 1p1sN6-0000UL-I4 for pgsql-hackers@arkaria.postgresql.org; Sun, 04 Dec 2022 17:01:44 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1p1sN5-0002Pr-BB for pgsql-hackers@arkaria.postgresql.org; Sun, 04 Dec 2022 17:01:43 +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 1p1sN5-0002O2-1Q for pgsql-hackers@lists.postgresql.org; Sun, 04 Dec 2022 17:01:43 +0000 Received: from relay4-d.mail.gandi.net ([217.70.183.196]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p1sN1-0008DN-PK for pgsql-hackers@lists.postgresql.org; Sun, 04 Dec 2022 17:01:41 +0000 Received: (Authenticated sender: vik@postgresfriends.org) by mail.gandi.net (Postfix) with ESMTPSA id ED509E0008; Sun, 4 Dec 2022 17:01:33 +0000 (UTC) Message-ID: Date: Sun, 4 Dec 2022 18:01:33 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: Error-safe user functions Content-Language: en-US To: Andrew Dunstan , Tom Lane Cc: Robert Haas , Corey Huinker , Nikita Glukhov , PostgreSQL Hackers 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> <1721519.1669934025@sss.pgh.pa.us> <1925585.1669990324@sss.pgh.pa.us> <02cf2f81-a776-37ff-291c-100480722a5c@dunslane.net> <2503569.1670104001@sss.pgh.pa.us> <2629670.1670167523@sss.pgh.pa.us> <4fb63750-6925-d444-b855-17927bd72bc4@dunslane.net> From: Vik Fearing In-Reply-To: <4fb63750-6925-d444-b855-17927bd72bc4@dunslane.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 12/4/22 17:21, Andrew Dunstan wrote: > > More generally, I can see uses for error free > casts, something like, say CAST(foo AS bar ON ERROR blurfl) What I am proposing for inclusion in the standard is basically the same as what JSON does: ::= CAST AS [ FORMAT ] [ ON ERROR ] ::= ERROR | NULL | DEFAULT Once/If I get that in, I will be pushing to get that syntax in postgres as well. -- Vik Fearing