This function appears to believe that it can PG_CATCH any random error
and then just carry on, without doing a subtransaction cleanup. This
is as wrong as can be. It might be all right if we had sufficiently
narrow constraints on what could happen inside the PG_TRY block, but in
point of fact it's calling datatype input functions, which could do
anything whatsoever. I think it needs to do PG_RE_THROW() not just
"return NULL" at the end of the CATCH. It looks like both of the
existing callers have cleanup logic, so this should be sufficient.
regards, tom lane