diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2022-12-09 10:14:53 -0500 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2022-12-09 10:14:53 -0500 |
commit | ccff2d20ed9622815df2a7deffce8a7b14830965 (patch) | |
tree | ef8439338d811e3c3b4fd6413f42662c128c70c2 /src/include/utils/builtins.h | |
parent | 1939d26282b27b4b264c6930830a7991ed83917a (diff) | |
download | postgresql-ccff2d20ed9622815df2a7deffce8a7b14830965.tar.gz |
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/builtins.h')
-rw-r--r-- | src/include/utils/builtins.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/include/utils/builtins.h b/src/include/utils/builtins.h index 81631f1645..10d13b0f1e 100644 --- a/src/include/utils/builtins.h +++ b/src/include/utils/builtins.h @@ -44,8 +44,11 @@ extern int namestrcmp(Name name, const char *str); /* numutils.c */ extern int16 pg_strtoint16(const char *s); +extern int16 pg_strtoint16_safe(const char *s, Node *escontext); extern int32 pg_strtoint32(const char *s); +extern int32 pg_strtoint32_safe(const char *s, Node *escontext); extern int64 pg_strtoint64(const char *s); +extern int64 pg_strtoint64_safe(const char *s, Node *escontext); extern int pg_itoa(int16 i, char *a); extern int pg_ultoa_n(uint32 value, char *a); extern int pg_ulltoa_n(uint64 value, char *a); |