From 378fa57918a5b4d01875e659dd8b72c557e4dded Mon Sep 17 00:00:00 2001 From: Vladimir Rachkin Date: Mon, 2 Dec 2024 16:29:36 +0300 Subject: [PATCH] Fix NULL input --- contrib/try_convert/try_convert.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/contrib/try_convert/try_convert.c b/contrib/try_convert/try_convert.c index b9fd8cac8f..30283d50bb 100644 --- a/contrib/try_convert/try_convert.c +++ b/contrib/try_convert/try_convert.c @@ -100,6 +100,10 @@ try_convert_via_io(Datum value, Oid sourceTypeId, Oid targetTypeId, bool *is_nul Datum try_convert(PG_FUNCTION_ARGS) { + if (fcinfo->argnull[0]) { + PG_RETURN_NULL(); + } + Oid sourceTypeId = get_fn_expr_argtype(fcinfo->flinfo, 0); Oid targetTypeId = get_fn_expr_argtype(fcinfo->flinfo, 1);