Re: Error-safe user functions - Mailing list pgsql-hackers

From Vik Fearing
Subject Re: Error-safe user functions
Date
Msg-id f8600a3b-f697-2577-8fea-f40d3e18bea8@postgresfriends.org
Whole thread Raw
In response to Re: Error-safe user functions  (Andrew Dunstan <andrew@dunslane.net>)
Responses Re: Error-safe user functions
List pgsql-hackers
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 specification> ::=
CAST <left paren>
     <cast operand> AS <cast target>
     [ FORMAT <cast template> ]
     [ <cast error behavior> ON ERROR ]
     <right paren>

<cast error behavior> ::=
     ERROR
   | NULL
   | DEFAULT <value expression>

Once/If I get that in, I will be pushing to get that syntax in postgres 
as well.
-- 
Vik Fearing




pgsql-hackers by date:

Previous
From: Vik Fearing
Date:
Subject: Re: Questions regarding distinct operation implementation
Next
From: Ankit Kumar Pandey
Date:
Subject: Re: Questions regarding distinct operation implementation