Convert range_in and multirange_in to report errors softly.
This is mostly straightforward, except that if the range type
has a canonical function, that might throw an error during range
input. (Such errors probably only occur for edge cases: in the
in-core canonical functions, it happens only if a bound has the
maximum valid value for the underlying type.) Hence, this patch
extends the soft-error regime to allow canonical functions to
return errors softly as well. Extensions implementing range
canonical functions will need modification anyway because of the
API change for range_serialize(); while at it, they might want
to do something similar to what's been done here in the in-core
canonical functions.
Discussion: https://postgr.es/m/3284599.1671075185@sss.pgh.pa.us
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/d35a1af468162f510b6139bf81a7a41fd8ba8500
Modified Files
--------------
src/backend/utils/adt/multirangetypes.c | 29 ++--
src/backend/utils/adt/multirangetypes_selfuncs.c | 3 +-
src/backend/utils/adt/rangetypes.c | 190 +++++++++++++++++------
src/backend/utils/adt/rangetypes_gist.c | 2 +-
src/backend/utils/adt/rangetypes_selfuncs.c | 2 +-
src/backend/utils/adt/rangetypes_spgist.c | 2 +-
src/backend/utils/adt/rangetypes_typanalyze.c | 3 +-
src/include/utils/rangetypes.h | 6 +-
src/test/regress/expected/multirangetypes.out | 31 ++++
src/test/regress/expected/rangetypes.out | 67 ++++++++
src/test/regress/sql/multirangetypes.sql | 7 +
src/test/regress/sql/rangetypes.sql | 13 ++
12 files changed, 289 insertions(+), 66 deletions(-)