On Mon, Oct 23, 2023 at 3:29 PM Jeevan Chalke <jeevan.cha...@enterprisedb.com> wrote: > > Attached are all three patches fixing the above comments. >
minor issue: /src/backend/utils/adt/jsonpath_exec.c 2531: Timestamp result; 2532: ErrorSaveContext escontext = {T_ErrorSaveContext}; 2533: 2534: /* Get a warning when precision is reduced */ 2535: time_precision = anytimestamp_typmod_check(false, 2536: time_precision); 2537: result = DatumGetTimestamp(value); 2538: AdjustTimestampForTypmod(&result, time_precision, 2539: (Node *) &escontext); 2540: if (escontext.error_occurred) 2541: RETURN_ERROR(ereport(ERROR, 2542: (errcode(ERRCODE_INVALID_ARGUMENT_FOR_SQL_JSON_DATETIME_FUNCTION), 2543: errmsg("numeric argument of jsonpath item method .%s() is out of range for type integer", 2544: jspOperationName(jsp->type))))); you already did anytimestamp_typmod_check. So this "if (escontext.error_occurred)" is unnecessary? A similar case applies to another function called anytimestamp_typmod_check. /src/backend/utils/adt/jsonpath_exec.c 1493: /* Convert numstr to Numeric with typmod */ 1494: Assert(numstr != NULL); 1495: noerr = DirectInputFunctionCallSafe(numeric_in, numstr, 1496: InvalidOid, dtypmod, 1497: (Node *) &escontext, 1498: &numdatum); 1499: 1500: if (!noerr || escontext.error_occurred) 1501: RETURN_ERROR(ereport(ERROR, 1502: (errcode(ERRCODE_NON_NUMERIC_SQL_JSON_ITEM), 1503: errmsg("string argument of jsonpath item method .%s() is not a valid representation of a decimal or number", 1504: jspOperationName(jsp->type))))); inside DirectInputFunctionCallSafe already "if (SOFT_ERROR_OCCURRED(escontext))" so "if (!noerr || escontext.error_occurred)" change to "if (!noerr)" should be fine?