diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2022-12-15 12:18:36 -0500 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2022-12-15 12:18:36 -0500 |
commit | d35a1af468162f510b6139bf81a7a41fd8ba8500 (patch) | |
tree | 26c76daf21e73a9ed1e64eb534cf9296370ca4b2 /src/include/utils/rangetypes.h | |
parent | 75f49221c22286104f032827359783aa5f4e6646 (diff) | |
download | postgresql-d35a1af468162f510b6139bf81a7a41fd8ba8500.tar.gz postgresql-d35a1af468162f510b6139bf81a7a41fd8ba8500.zip |
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
Diffstat (limited to 'src/include/utils/rangetypes.h')
-rw-r--r-- | src/include/utils/rangetypes.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/include/utils/rangetypes.h b/src/include/utils/rangetypes.h index 2eee6a6c1f8..3ae13cb9fb6 100644 --- a/src/include/utils/rangetypes.h +++ b/src/include/utils/rangetypes.h @@ -143,14 +143,16 @@ extern RangeType *range_intersect_internal(TypeCacheEntry *typcache, const Range extern TypeCacheEntry *range_get_typcache(FunctionCallInfo fcinfo, Oid rngtypid); extern RangeType *range_serialize(TypeCacheEntry *typcache, RangeBound *lower, - RangeBound *upper, bool empty); + RangeBound *upper, bool empty, + struct Node *escontext); extern void range_deserialize(TypeCacheEntry *typcache, const RangeType *range, RangeBound *lower, RangeBound *upper, bool *empty); extern char range_get_flags(const RangeType *range); extern void range_set_contain_empty(RangeType *range); extern RangeType *make_range(TypeCacheEntry *typcache, RangeBound *lower, - RangeBound *upper, bool empty); + RangeBound *upper, bool empty, + struct Node *escontext); extern int range_cmp_bounds(TypeCacheEntry *typcache, const RangeBound *b1, const RangeBound *b2); extern int range_cmp_bound_values(TypeCacheEntry *typcache, const RangeBound *b1, |