aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/uuid.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2022-12-14 18:03:11 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2022-12-14 18:03:11 -0500
commit90161dad4dd719f44255474f4471af916f2a28f0 (patch)
tree3133eabda50dd4b11f4d02aecefe875b7961547d /src/backend/utils/adt/uuid.c
parent47f3f97fcdee28e3eb70cd2ebfd7b4899570b018 (diff)
downloadpostgresql-90161dad4dd719f44255474f4471af916f2a28f0.tar.gz
postgresql-90161dad4dd719f44255474f4471af916f2a28f0.zip
Convert a few more datatype input functions to report errors softly.
Convert cash_in and uuid_in to the new style. Amul Sul, minor mods by me Discussion: https://postgr.es/m/CAAJ_b97KeDWUdpTKGOaFYPv0OicjOu6EW+QYWj-Ywrgj_aEy1g@mail.gmail.com
Diffstat (limited to 'src/backend/utils/adt/uuid.c')
-rw-r--r--src/backend/utils/adt/uuid.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/backend/utils/adt/uuid.c b/src/backend/utils/adt/uuid.c
index 7cec9372485..e86635a4ac3 100644
--- a/src/backend/utils/adt/uuid.c
+++ b/src/backend/utils/adt/uuid.c
@@ -31,7 +31,7 @@ typedef struct
hyperLogLogState abbr_card; /* cardinality estimator */
} uuid_sortsupport_state;
-static void string_to_uuid(const char *source, pg_uuid_t *uuid);
+static void string_to_uuid(const char *source, pg_uuid_t *uuid, Node *escontext);
static int uuid_internal_cmp(const pg_uuid_t *arg1, const pg_uuid_t *arg2);
static int uuid_fast_cmp(Datum x, Datum y, SortSupport ssup);
static bool uuid_abbrev_abort(int memtupcount, SortSupport ssup);
@@ -44,7 +44,7 @@ uuid_in(PG_FUNCTION_ARGS)
pg_uuid_t *uuid;
uuid = (pg_uuid_t *) palloc(sizeof(*uuid));
- string_to_uuid(uuid_str, uuid);
+ string_to_uuid(uuid_str, uuid, fcinfo->context);
PG_RETURN_UUID_P(uuid);
}
@@ -87,7 +87,7 @@ uuid_out(PG_FUNCTION_ARGS)
* digits, is the only one used for output.)
*/
static void
-string_to_uuid(const char *source, pg_uuid_t *uuid)
+string_to_uuid(const char *source, pg_uuid_t *uuid, Node *escontext)
{
const char *src = source;
bool braces = false;
@@ -130,7 +130,7 @@ string_to_uuid(const char *source, pg_uuid_t *uuid)
return;
syntax_error:
- ereport(ERROR,
+ ereturn(escontext,,
(errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
errmsg("invalid input syntax for type %s: \"%s\"",
"uuid", source)));