aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorAlexander Korotkov <akorotkov@postgresql.org>2019-03-16 12:21:19 +0300
committerAlexander Korotkov <akorotkov@postgresql.org>2019-03-16 12:21:19 +0300
commit16d489b0fe058e527619f5e9d92fd7ca3c6c2994 (patch)
treed0f82a4250a33db045574fc69137eb32d52d04f9 /src/include
parent72b6460336e86ad5cafd3426af6013c7d8457367 (diff)
downloadpostgresql-16d489b0fe058e527619f5e9d92fd7ca3c6c2994.tar.gz
postgresql-16d489b0fe058e527619f5e9d92fd7ca3c6c2994.zip
Numeric error suppression in jsonpath
Add support of numeric error suppression to jsonpath as it's required by standard. This commit doesn't use PG_TRY()/PG_CATCH() in order to implement that. Instead, it provides internal versions of numeric functions used, which support error suppression. Discussion: https://postgr.es/m/fcc6fc6a-b497-f39a-923d-aa34d0c588e8%402ndQuadrant.com Author: Alexander Korotkov, Nikita Glukhov Reviewed-by: Tomas Vondra
Diffstat (limited to 'src/include')
-rw-r--r--src/include/utils/float.h3
-rw-r--r--src/include/utils/numeric.h12
2 files changed, 15 insertions, 0 deletions
diff --git a/src/include/utils/float.h b/src/include/utils/float.h
index 0f82a25edea..5d935bb032d 100644
--- a/src/include/utils/float.h
+++ b/src/include/utils/float.h
@@ -40,6 +40,9 @@ extern PGDLLIMPORT int extra_float_digits;
extern int is_infinite(float8 val);
extern float8 float8in_internal(char *num, char **endptr_p,
const char *type_name, const char *orig_string);
+extern float8 float8in_internal_opt_error(char *num, char **endptr_p,
+ const char *type_name, const char *orig_string,
+ bool *have_error);
extern char *float8out_internal(float8 num);
extern int float4_cmp_internal(float4 a, float4 b);
extern int float8_cmp_internal(float8 a, float8 b);
diff --git a/src/include/utils/numeric.h b/src/include/utils/numeric.h
index 9109cff98eb..b475c93e047 100644
--- a/src/include/utils/numeric.h
+++ b/src/include/utils/numeric.h
@@ -61,4 +61,16 @@ int32 numeric_maximum_size(int32 typmod);
extern char *numeric_out_sci(Numeric num, int scale);
extern char *numeric_normalize(Numeric num);
+extern Numeric numeric_add_opt_error(Numeric num1, Numeric num2,
+ bool *have_error);
+extern Numeric numeric_sub_opt_error(Numeric num1, Numeric num2,
+ bool *have_error);
+extern Numeric numeric_mul_opt_error(Numeric num1, Numeric num2,
+ bool *have_error);
+extern Numeric numeric_div_opt_error(Numeric num1, Numeric num2,
+ bool *have_error);
+extern Numeric numeric_mod_opt_error(Numeric num1, Numeric num2,
+ bool *have_error);
+extern int32 numeric_int4_opt_error(Numeric num, bool *error);
+
#endif /* _PG_NUMERIC_H_ */