From ccff2d20ed9622815df2a7deffce8a7b14830965 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Fri, 9 Dec 2022 10:14:53 -0500 Subject: 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 --- src/backend/utils/adt/geo_ops.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/backend/utils/adt/geo_ops.c') diff --git a/src/backend/utils/adt/geo_ops.c b/src/backend/utils/adt/geo_ops.c index d78002b901d..721ce6634f8 100644 --- a/src/backend/utils/adt/geo_ops.c +++ b/src/backend/utils/adt/geo_ops.c @@ -189,7 +189,7 @@ static float8 single_decode(char *num, char **endptr_p, const char *type_name, const char *orig_string) { - return float8in_internal(num, endptr_p, type_name, orig_string); + return float8in_internal(num, endptr_p, type_name, orig_string, NULL); } /* single_decode() */ static void @@ -212,7 +212,7 @@ pair_decode(char *str, float8 *x, float8 *y, char **endptr_p, if ((has_delim = (*str == LDELIM))) str++; - *x = float8in_internal(str, &str, type_name, orig_string); + *x = float8in_internal(str, &str, type_name, orig_string, NULL); if (*str++ != DELIM) ereport(ERROR, @@ -220,7 +220,7 @@ pair_decode(char *str, float8 *x, float8 *y, char **endptr_p, errmsg("invalid input syntax for type %s: \"%s\"", type_name, orig_string))); - *y = float8in_internal(str, &str, type_name, orig_string); + *y = float8in_internal(str, &str, type_name, orig_string, NULL); if (has_delim) { -- cgit v1.2.3