PostgreSQL has a pg_input_error_info()
function that allows us to see the error details that would be returned if we were to pass an invalid value for the specified data type.
Basically it tests whether the given string is valid input for the specified data type. If invalid, it returns the details of the error that would have been thrown. If valid, the result is null
.