aboutsummaryrefslogtreecommitdiff
path: root/src/include/utils/array.h
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2022-12-09 10:14:53 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2022-12-09 10:14:53 -0500
commitccff2d20ed9622815df2a7deffce8a7b14830965 (patch)
treeef8439338d811e3c3b4fd6413f42662c128c70c2 /src/include/utils/array.h
parent1939d26282b27b4b264c6930830a7991ed83917a (diff)
downloadpostgresql-ccff2d20ed9622815df2a7deffce8a7b14830965.tar.gz
postgresql-ccff2d20ed9622815df2a7deffce8a7b14830965.zip
Convert a few datatype input functions to use "soft" error reporting.
This patch converts the input functions for bool, int2, int4, int8, float4, float8, numeric, and contrib/cube to the new soft-error style. array_in and record_in are also converted. There's lots more to do, but this is enough to provide proof-of-concept that the soft-error API is usable, as well as reference examples for how to convert input functions. This patch is mostly by me, but it owes very substantial debt to earlier work by Nikita Glukhov, Andrew Dunstan, and Amul Sul. Thanks to Andres Freund for review. Discussion: https://postgr.es/m/3bbbb0df-7382-bf87-9737-340ba096e034@postgrespro.ru
Diffstat (limited to 'src/include/utils/array.h')
-rw-r--r--src/include/utils/array.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/include/utils/array.h b/src/include/utils/array.h
index 2f794d11682..3f6319aed5a 100644
--- a/src/include/utils/array.h
+++ b/src/include/utils/array.h
@@ -447,7 +447,11 @@ extern void array_free_iterator(ArrayIterator iterator);
extern int ArrayGetOffset(int n, const int *dim, const int *lb, const int *indx);
extern int ArrayGetOffset0(int n, const int *tup, const int *scale);
extern int ArrayGetNItems(int ndim, const int *dims);
+extern int ArrayGetNItemsSafe(int ndim, const int *dims,
+ struct Node *escontext);
extern void ArrayCheckBounds(int ndim, const int *dims, const int *lb);
+extern bool ArrayCheckBoundsSafe(int ndim, const int *dims, const int *lb,
+ struct Node *escontext);
extern void mda_get_range(int n, int *span, const int *st, const int *endp);
extern void mda_get_prod(int n, const int *range, int *prod);
extern void mda_get_offset_values(int n, int *dist, const int *prod, const int *span);