Re: Error-safe user functions

From: Vik Fearing <vik(at)postgresfriends(dot)org>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Corey Huinker <corey(dot)huinker(at)gmail(dot)com>, Nikita Glukhov <n(dot)gluhov(at)postgrespro(dot)ru>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Error-safe user functions
Date: 2022-12-04 17:01:33
Message-ID: f8600a3b-f697-2577-8fea-f40d3e18bea8@postgresfriends.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ankit Kumar Pandey 2022-12-04 17:09:05 Re: Questions regarding distinct operation implementation
Previous Message Vik Fearing 2022-12-04 16:55:06 Re: Questions regarding distinct operation implementation