int32 value = strtol(str, &endptr, 10);
there is no int32 value range check?
imitate src/backend/utils/adt/int.c. the following way is what I came up with.
int64 value = strtol(str, &endptr, 10);
if (errno == ERANGE || value < INT_MIN || value > INT_MAX)
ereturn(fcinfo->context, (Datum) 0,
(errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
errmsg("value \"%s\" is out of range for type %s", str,
"integer")));
set = hashset_add_element(set, (int32)value);
also it will infinity loop in hashset_in if supply the wrong value....
example select '{1,2s}'::hashset;
I need kill -9 to kill the process.