136 #define jperIsError(jper) ((jper) == jperError) 155 #define jspStrictAbsenseOfErrors(cxt) (!(cxt)->laxMode) 156 #define jspAutoUnwrap(cxt) ((cxt)->laxMode) 157 #define jspAutoWrap(cxt) ((cxt)->laxMode) 158 #define jspIgnoreStructuralErrors(cxt) ((cxt)->ignoreStructuralErrors) 159 #define jspThrowErrors(cxt) ((cxt)->throwErrors) 162 #define RETURN_ERROR(throw_error) \ 164 if (jspThrowErrors(cxt)) \ 177 Jsonb *json,
bool throwErrors,
201 bool ignoreStructuralErrors,
bool unwrapNext);
255 bool useTz,
bool *have_error);
359 (
errcode(ERRCODE_SINGLETON_SQL_JSON_ITEM_REQUIRED),
360 errmsg(
"single boolean result is expected")));
555 (
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
556 errmsg(
"\"vars\" argument is not an object"),
557 errdetail(
"Jsonpath parameters should be encoded as key-value pairs of \"vars\" object.")));
673 (
errcode(ERRCODE_SQL_JSON_MEMBER_NOT_FOUND), \
674 errmsg(
"JSON object does not contain key \"%s\"",
676 key.
val.string.len))));
685 (
errcode(ERRCODE_SQL_JSON_MEMBER_NOT_FOUND),
686 errmsg(
"jsonpath member accessor can only be applied to an object"))));
714 (
errcode(ERRCODE_SQL_JSON_ARRAY_NOT_FOUND),
715 errmsg(
"jsonpath wildcard array accessor can only be applied to an array"))));
724 bool singleton = size < 0;
755 index_to = index_from;
759 index_from > index_to ||
762 (
errcode(ERRCODE_INVALID_SQL_JSON_SUBSCRIPT),
763 errmsg(
"jsonpath array subscript is out of bounds"))));
768 if (index_to >= size)
773 for (index = index_from; index <= index_to; index++)
794 if (!hasNext && !found)
803 if (res ==
jperOk && !found)
810 if (res ==
jperOk && !found)
819 (
errcode(ERRCODE_SQL_JSON_ARRAY_NOT_FOUND),
820 errmsg(
"jsonpath array accessor can only be applied to an array"))));
832 elog(
ERROR,
"evaluating jsonpath LAST outside of array subscript");
834 if (!hasNext && !found)
842 lastjbv = hasNext ? &tmpjbv :
palloc(
sizeof(*lastjbv));
848 lastjbv, found, hasNext);
861 (cxt, hasNext ? &elem : NULL,
862 jb->
val.binary.data, found, 1, 1, 1,
871 (
errcode(ERRCODE_SQL_JSON_OBJECT_NOT_FOUND),
872 errmsg(
"jsonpath wildcard member accessor can only be applied to an object"))));
928 bool savedIgnoreStructuralErrors;
936 if (res ==
jperOk && !found)
942 (cxt, hasNext ? &elem : NULL,
943 jb->
val.binary.data, found,
961 if (!hasNext && !found)
967 v = hasNext ? &vbuf :
palloc(
sizeof(*v));
984 jbv->
val.string.len = strlen(jbv->
val.string.val);
1001 (
errcode(ERRCODE_SQL_JSON_ARRAY_NOT_FOUND),
1002 errmsg(
"jsonpath item method .%s() can only be applied to an array",
1010 jb =
palloc(
sizeof(*jb));
1044 bool have_error =
false;
1052 if (have_error || isinf(val) || isnan(val))
1054 (
errcode(ERRCODE_NON_NUMERIC_SQL_JSON_ITEM),
1055 errmsg(
"numeric argument of jsonpath item method .%s() is out of range for type double precision",
1064 jb->
val.string.len);
1065 bool have_error =
false;
1073 if (have_error || isinf(val) || isnan(val))
1075 (
errcode(ERRCODE_NON_NUMERIC_SQL_JSON_ITEM),
1076 errmsg(
"string argument of jsonpath item method .%s() is not a valid representation of a double precision number",
1088 (
errcode(ERRCODE_NON_NUMERIC_SQL_JSON_ITEM),
1089 errmsg(
"jsonpath item method .%s() can only be applied to a string or numeric value",
1109 elog(
ERROR,
"unrecognized jsonpath item type: %d", jsp->
type);
1121 bool unwrapElements)
1126 elog(
ERROR,
"invalid jsonb array value type: %d", jb->
type);
1130 (cxt, jsp, jb->
val.binary.data, found, 1, 1, 1,
1131 false, unwrapElements);
1147 hasNext = next != NULL;
1231 elog(
ERROR,
"boolean jsonpath item cannot have next item");
1250 return res2 ==
jpbTrue ? res : res2;
1262 return res2 ==
jpbFalse ? res : res2;
1345 elog(
ERROR,
"invalid boolean jsonpath item type: %d", jsp->
type);
1378 bool ignoreStructuralErrors,
bool unwrapNext)
1406 if (level >= first ||
1413 if (ignoreStructuralErrors)
1415 bool savedIgnoreStructuralErrors;
1428 if (res ==
jperOk && !found)
1440 (cxt, jsp, v.
val.binary.data, found,
1441 level + 1, first, last,
1442 ignoreStructuralErrors, unwrapNext);
1447 if (res ==
jperOk && found == NULL)
1489 unwrapRightArg, &rseq);
1508 while (rarg ? (rval != NULL) : first)
1578 (
errcode(ERRCODE_SINGLETON_SQL_JSON_ITEM_REQUIRED),
1579 errmsg(
"left operand of jsonpath operator %s is not a single numeric value",
1585 (
errcode(ERRCODE_SINGLETON_SQL_JSON_ITEM_REQUIRED),
1586 errmsg(
"right operand of jsonpath operator %s is not a single numeric value",
1591 res = func(lval->
val.numeric, rval->
val.numeric, NULL);
1597 res = func(lval->
val.numeric, rval->
val.numeric, &error);
1606 lval =
palloc(
sizeof(*lval));
1608 lval->
val.numeric = res;
1644 if (!found && !hasNext)
1649 if (!found && !hasNext)
1653 (
errcode(ERRCODE_SQL_JSON_NUMBER_NOT_FOUND),
1654 errmsg(
"operand of unary jsonpath operator %s is not a numeric value",
1694 if (whole->
val.string.len >= initial->
val.string.len &&
1695 !memcmp(whole->
val.string.val,
1696 initial->
val.string.val,
1697 initial->
val.string.len))
1727 str->
val.string.len,
1728 cxt->
cflags, DEFAULT_COLLATION_OID, 0, NULL))
1751 (
errcode(ERRCODE_NON_NUMERIC_SQL_JSON_ITEM),
1752 errmsg(
"jsonpath item method .%s() can only be applied to a numeric value",
1760 jb =
palloc(
sizeof(*jb));
1791 (
errcode(ERRCODE_INVALID_ARGUMENT_FOR_SQL_JSON_DATETIME_FUNCTION),
1792 errmsg(
"jsonpath item method .%s() can only be applied to a string",
1796 jb->
val.string.len);
1803 collid = DEFAULT_COLLATION_OID;
1810 bool have_error =
false;
1815 elog(
ERROR,
"invalid jsonpath item type for .datetime() argument");
1823 &typid, &typmod, &tz,
1840 static const char *fmt_str[] =
1843 "HH24:MI:SSTZH:TZM",
1846 "yyyy-mm-dd HH24:MI:SSTZH:TZM",
1847 "yyyy-mm-dd HH24:MI:SSTZH",
1848 "yyyy-mm-dd HH24:MI:SS",
1849 "yyyy-mm-dd\"T\"HH24:MI:SSTZH:TZM",
1850 "yyyy-mm-dd\"T\"HH24:MI:SSTZH",
1851 "yyyy-mm-dd\"T\"HH24:MI:SS" 1859 for (i = 0; i <
lengthof(fmt_str); i++)
1861 bool have_error =
false;
1873 &typid, &typmod, &tz,
1885 (
errcode(ERRCODE_INVALID_ARGUMENT_FOR_SQL_JSON_DATETIME_FUNCTION),
1886 errmsg(
"datetime format is not recognized: \"%s\"",
1888 errhint(
"Use a datetime template argument to specify the input data format."))));
1898 if (!hasNext && !found)
1901 jb = hasNext ? &jbvbuf :
palloc(
sizeof(*jb));
1905 jb->
val.datetime.typid = typid;
1906 jb->
val.datetime.typmod = typmod;
1907 jb->
val.datetime.tz = tz;
1955 (
errcode(ERRCODE_SQL_JSON_OBJECT_NOT_FOUND),
1956 errmsg(
"jsonpath item method .%s() can only be applied to an object",
1959 jbc = jb->
val.binary.data;
1967 keystr.
val.string.val =
"key";
1968 keystr.
val.string.len = 3;
1971 valstr.
val.string.val =
"value";
1972 valstr.
val.string.len = 5;
1975 idstr.
val.string.val =
"id";
1976 idstr.
val.string.len = 2;
1981 id += (int64) cxt->
baseObject.
id * INT64CONST(10000000000);
2001 if (!hasNext && !found)
2034 if (res ==
jperOk && !found)
2093 &value->
val.string.len);
2099 elog(
ERROR,
"unexpected jsonpath item type");
2124 tmp.
val.string.val = varName;
2125 tmp.
val.string.len = varNameLength;
2137 (
errcode(ERRCODE_UNDEFINED_OBJECT),
2138 errmsg(
"could not find jsonpath variable \"%s\"",
2139 pnstrdup(varName, varNameLength))));
2181 const char *
s2,
int len2)
2185 cmp = memcmp(s1, s2,
Min(len1, len2));
2193 return len1 < len2 ? -1 : 1;
2202 const char *mbstr2,
int mblen2)
2230 utf8len1 = (mbstr1 == utf8str1) ? mblen1 : strlen(utf8str1);
2231 utf8len2 = (mbstr2 == utf8str2) ? mblen2 : strlen(utf8str2);
2239 if (mbstr1 == utf8str1 && mbstr2 == utf8str2)
2243 if (mbstr1 != utf8str1)
2245 if (mbstr2 != utf8str2)
2293 cmp = jb1->
val.boolean == jb2->
val.boolean ? 0 :
2294 jb1->
val.boolean ? 1 : -1;
2301 return jb1->
val.string.len != jb2->
val.string.len ||
2302 memcmp(jb1->
val.string.val,
2303 jb2->
val.string.val,
2307 jb2->
val.string.val, jb2->
val.string.len);
2314 jb1->
val.datetime.typid,
2315 jb2->
val.datetime.value,
2316 jb2->
val.datetime.typid,
2355 elog(
ERROR,
"unrecognized jsonpath operation: %d", op);
2392 Datum numeric_index;
2393 bool have_error =
false;
2401 (
errcode(ERRCODE_INVALID_SQL_JSON_SUBSCRIPT),
2402 errmsg(
"jsonpath array subscript is not a single numeric value"))));
2413 (
errcode(ERRCODE_INVALID_SQL_JSON_SUBSCRIPT),
2414 errmsg(
"jsonpath array subscript is out of integer range"))));
2440 else if (!jvl->
list)
2524 jbv->
val.binary.data = &jb->
root;
2564 return scalar->
type == type ? scalar : NULL;
2590 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
2591 errmsg(
"cannot convert value from %s to %s without time zone usage",
2593 errhint(
"Use *_tz() function for time zone support.")));
2644 bool useTz,
bool *cast_error)
2648 *cast_error =
false;
2665 case TIMESTAMPTZOID:
2676 elog(
ERROR,
"unrecognized SQL/JSON datetime type oid: %u",
2697 case TIMESTAMPTZOID:
2702 elog(
ERROR,
"unrecognized SQL/JSON datetime type oid: %u",
2723 case TIMESTAMPTZOID:
2728 elog(
ERROR,
"unrecognized SQL/JSON datetime type oid: %u",
2746 case TIMESTAMPTZOID:
2757 elog(
ERROR,
"unrecognized SQL/JSON datetime type oid: %u",
2762 case TIMESTAMPTZOID:
2775 case TIMESTAMPTZOID:
2786 elog(
ERROR,
"unrecognized SQL/JSON datetime type oid: %u",
2792 elog(
ERROR,
"unrecognized SQL/JSON datetime type oid: %u", typid1);
#define list_make2(x1, x2)
static Datum castTimeToTimeTz(Datum time, bool useTz)
static void JsonValueListInitIterator(const JsonValueList *jvl, JsonValueListIterator *it)
Datum timetz_cmp(PG_FUNCTION_ARGS)
#define RETURN_ERROR(throw_error)
#define jperIsError(jper)
#define jspIgnoreStructuralErrors(cxt)
Datum(* PGFunction)(FunctionCallInfo fcinfo)
static int JsonbType(JsonbValue *jb)
static JsonPathBool executeBoolItem(JsonPathExecContext *cxt, JsonPathItem *jsp, JsonbValue *jb, bool canHaveNext)
#define DatumGetDateADT(X)
Datum numeric_trunc(PG_FUNCTION_ARGS)
int errhint(const char *fmt,...)
bool JsonbExtractScalar(JsonbContainer *jbc, JsonbValue *res)
char * pnstrdup(const char *in, Size len)
Jsonb * JsonbValueToJsonb(JsonbValue *val)
static JsonPathExecResult executeBinaryArithmExpr(JsonPathExecContext *cxt, JsonPathItem *jsp, JsonbValue *jb, BinaryArithmFunc func, JsonValueList *found)
bool jspGetNext(JsonPathItem *v, JsonPathItem *a)
static ListCell * lnext(const List *l, const ListCell *c)
JsonPathBool(* JsonPathPredicateCallback)(JsonPathItem *jsp, JsonbValue *larg, JsonbValue *rarg, void *param)
Datum timestamp_cmp(PG_FUNCTION_ARGS)
static Datum jsonb_path_match_internal(FunctionCallInfo fcinfo, bool tz)
static JsonPathBool executeNestedBoolItem(JsonPathExecContext *cxt, JsonPathItem *jsp, JsonbValue *jb)
struct JsonBaseObjectInfo JsonBaseObjectInfo
static JsonPathExecResult executeUnaryArithmExpr(JsonPathExecContext *cxt, JsonPathItem *jsp, JsonbValue *jb, PGFunction func, JsonValueList *found)
Numeric numeric_add_opt_error(Numeric num1, Numeric num2, bool *have_error)
#define SRF_IS_FIRSTCALL()
#define JsonbPGetDatum(p)
struct JsonValueList JsonValueList
Datum jsonb_path_exists(PG_FUNCTION_ARGS)
Numeric numeric_div_opt_error(Numeric num1, Numeric num2, bool *have_error)
char * pstrdup(const char *in)
#define NumericGetDatum(X)
Datum jsonb_path_query_array(PG_FUNCTION_ARGS)
#define JsonContainerIsScalar(jc)
Datum numeric_out(PG_FUNCTION_ARGS)
Datum numeric_cmp(PG_FUNCTION_ARGS)
#define PG_GETARG_JSONB_P_COPY(x)
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
static bool JsonValueListIsEmpty(JsonValueList *jvl)
void jspInitByBuffer(JsonPathItem *v, char *base, int32 pos)
int errcode(int sqlerrcode)
static JsonbValue * getScalar(JsonbValue *scalar, enum jbvType type)
static JsonbValue * JsonValueListNext(const JsonValueList *jvl, JsonValueListIterator *it)
static int JsonValueListLength(const JsonValueList *jvl)
#define DirectFunctionCall1(func, arg1)
#define PG_GETARG_BOOL(n)
struct NumericData * Numeric
JsonBaseObjectInfo baseObject
#define SRF_PERCALL_SETUP()
Datum jsonb_path_match(PG_FUNCTION_ARGS)
Datum jsonb_path_exists_opr(PG_FUNCTION_ARGS)
static Datum jsonb_path_query_array_internal(FunctionCallInfo fcinfo, bool tz)
Numeric numeric_mul_opt_error(Numeric num1, Numeric num2, bool *have_error)
int32 timestamp_cmp_timestamptz_internal(Timestamp timestampVal, TimestampTz dt2)
static int compareNumeric(Numeric a, Numeric b)
char * pg_server_to_any(const char *s, int len, int encoding)
static JsonPathExecResult getArrayIndex(JsonPathExecContext *cxt, JsonPathItem *jsp, JsonbValue *jb, int32 *index)
Datum Float8GetDatum(float8 X)
static int compareDatetime(Datum val1, Oid typid1, Datum val2, Oid typid2, bool useTz, bool *have_error)
static void getJsonPathItem(JsonPathExecContext *cxt, JsonPathItem *item, JsonbValue *value)
static JsonbValue * copyJsonbValue(JsonbValue *src)
#define SRF_RETURN_NEXT(_funcctx, _result)
Datum jsonb_path_query_tz(PG_FUNCTION_ARGS)
JsonbValue * pushJsonbValue(JsonbParseState **pstate, JsonbIteratorToken seq, JsonbValue *jbval)
static JsonPathExecResult executeNumericItemMethod(JsonPathExecContext *cxt, JsonPathItem *jsp, JsonbValue *jb, bool unwrap, PGFunction func, JsonValueList *found)
void pfree(void *pointer)
static int compareStrings(const char *mbstr1, int mblen1, const char *mbstr2, int mblen2)
static JsonbValue * wrapItemsInArray(const JsonValueList *items)
Datum jsonb_path_match_opr(PG_FUNCTION_ARGS)
Datum numeric_uminus(PG_FUNCTION_ARGS)
Datum numeric_abs(PG_FUNCTION_ARGS)
static JsonPathBool executeStartsWith(JsonPathItem *jsp, JsonbValue *whole, JsonbValue *initial, void *param)
static JsonPathExecResult executeAnyItem(JsonPathExecContext *cxt, JsonPathItem *jsp, JsonbContainer *jbc, JsonValueList *found, uint32 level, uint32 first, uint32 last, bool ignoreStructuralErrors, bool unwrapNext)
static JsonPathExecResult executeJsonPath(JsonPath *path, Jsonb *vars, Jsonb *json, bool throwErrors, JsonValueList *result, bool useTz)
#define DatumGetCString(X)
Datum time_cmp(PG_FUNCTION_ARGS)
static List * JsonValueListGetList(JsonValueList *jvl)
static JsonPathExecResult executeItem(JsonPathExecContext *cxt, JsonPathItem *jsp, JsonbValue *jb, JsonValueList *found)
bool RE_compile_and_execute(text *text_re, char *dat, int dat_len, int cflags, Oid collation, int nmatch, regmatch_t *pmatch)
#define PG_GETARG_JSONPATH_P_COPY(x)
static Datum jsonb_path_query_internal(FunctionCallInfo fcinfo, bool tz)
struct JsonValueListIterator JsonValueListIterator
const char * JsonbTypeName(JsonbValue *jbv)
Datum jsonb_path_exists_tz(PG_FUNCTION_ARGS)
text * cstring_to_text_with_len(const char *s, int len)
void check_stack_depth(void)
#define DatumGetTimestampTz(X)
Numeric int64_to_numeric(int64 val)
static ListCell * list_second_cell(const List *l)
int errdetail(const char *fmt,...)
struct JsonPathItem::@129::@131 array
static JsonPathExecResult executeItemUnwrapTargetArray(JsonPathExecContext *cxt, JsonPathItem *jsp, JsonbValue *jb, JsonValueList *found, bool unwrapElements)
#define JsonContainerSize(jc)
static ListCell * list_head(const List *l)
static struct cvec * range(struct vars *v, chr a, chr b, int cases)
#define jspThrowErrors(cxt)
struct JsonPathItem::@129::@132 anybounds
#define JsonContainerIsArray(jc)
struct JsonLikeRegexContext JsonLikeRegexContext
static void checkTimezoneIsUsedForCast(bool useTz, const char *type1, const char *type2)
MemoryContext TopMemoryContext
List * lappend(List *list, void *datum)
Datum numeric_floor(PG_FUNCTION_ARGS)
#define PG_GETARG_JSONPATH_P(x)
static Datum jsonb_path_query_first_internal(FunctionCallInfo fcinfo, bool tz)
struct JsonPathItem::@129::@134 like_regex
static JsonPathBool executePredicate(JsonPathExecContext *cxt, JsonPathItem *pred, JsonPathItem *larg, JsonPathItem *rarg, JsonbValue *jb, bool unwrapRightArg, JsonPathPredicateCallback exec, void *param)
union JsonPathItem::@129 content
static JsonPathBool executeLikeRegex(JsonPathItem *jsp, JsonbValue *str, JsonbValue *rarg, void *param)
const char * jspOperationName(JsonPathItemType type)
Datum jsonb_path_query(PG_FUNCTION_ARGS)
void jspGetRightArg(JsonPathItem *v, JsonPathItem *a)
static JsonPathExecResult executeItemOptUnwrapResultNoThrow(JsonPathExecContext *cxt, JsonPathItem *jsp, JsonbValue *jb, bool unwrap, JsonValueList *found)
int32 numeric_int4_opt_error(Numeric num, bool *have_error)
bool ignoreStructuralErrors
#define PG_RETURN_BOOL(x)
#define JsonContainerIsObject(jc)
int GetDatabaseEncoding(void)
Numeric(* BinaryArithmFunc)(Numeric num1, Numeric num2, bool *error)
Datum float8_numeric(PG_FUNCTION_ARGS)
static int cmpDateToTimestampTz(DateADT date1, TimestampTz tstz2, bool useTz)
bool jspGetBool(JsonPathItem *v)
Numeric numeric_mod_opt_error(Numeric num1, Numeric num2, bool *have_error)
#define ereport(elevel,...)
static JsonBaseObjectInfo setBaseObject(JsonPathExecContext *cxt, JsonbValue *jbv, int32 id)
static JsonbValue * JsonbInitBinary(JsonbValue *jbv, Jsonb *jb)
text * cstring_to_text(const char *s)
JsonbValue * getIthJsonbValueFromContainer(JsonbContainer *container, uint32 i)
static void JsonValueListAppend(JsonValueList *jvl, JsonbValue *jbv)
#define DatumGetNumeric(X)
Datum jsonb_path_query_array_tz(PG_FUNCTION_ARGS)
bool jspGetArraySubscript(JsonPathItem *v, JsonPathItem *from, JsonPathItem *to, int i)
void jspGetLeftArg(JsonPathItem *v, JsonPathItem *a)
#define Assert(condition)
JsonbIterator * JsonbIteratorInit(JsonbContainer *container)
static JsonPathBool compareItems(int32 op, JsonbValue *jb1, JsonbValue *jb2, bool useTz)
static int binaryCompareStrings(const char *s1, int len1, const char *s2, int len2)
Datum jsonb_path_query_first_tz(PG_FUNCTION_ARGS)
int lastGeneratedObjectId
MemoryContext multi_call_memory_ctx
static int list_length(const List *l)
Datum date_cmp(PG_FUNCTION_ARGS)
#define PG_FREE_IF_COPY(ptr, n)
struct JsonPathExecContext JsonPathExecContext
int jspConvertRegexFlags(uint32 xflags)
static JsonPathExecResult executeKeyValueMethod(JsonPathExecContext *cxt, JsonPathItem *jsp, JsonbValue *jb, JsonValueList *found)
Datum jsonb_path_match_tz(PG_FUNCTION_ARGS)
Datum time_timetz(PG_FUNCTION_ARGS)
static void getJsonPathVariable(JsonPathExecContext *cxt, JsonPathItem *variable, Jsonb *vars, JsonbValue *value)
static JsonPathExecResult appendBoolResult(JsonPathExecContext *cxt, JsonPathItem *jsp, JsonValueList *found, JsonPathBool res)
static Datum jsonb_path_exists_internal(FunctionCallInfo fcinfo, bool tz)
char * text_to_cstring(const text *t)
static JsonPathExecResult executeItemOptUnwrapTarget(JsonPathExecContext *cxt, JsonPathItem *jsp, JsonbValue *jb, JsonValueList *found, bool unwrap)
#define VARSIZE_ANY_EXHDR(PTR)
int errmsg(const char *fmt,...)
Datum numeric_ceil(PG_FUNCTION_ARGS)
void jspInit(JsonPathItem *v, JsonPath *js)
Datum jsonb_path_query_first(PG_FUNCTION_ARGS)
Numeric numeric_sub_opt_error(Numeric num1, Numeric num2, bool *have_error)
static JsonPathBool executeComparison(JsonPathItem *cmp, JsonbValue *lv, JsonbValue *rv, void *p)
int32 date_cmp_timestamptz_internal(DateADT dateVal, TimestampTz dt2)
#define jspAutoUnwrap(cxt)
double float8in_internal_opt_error(char *num, char **endptr_p, const char *type_name, const char *orig_string, bool *have_error)
static JsonPathExecResult executeDateTimeMethod(JsonPathExecContext *cxt, JsonPathItem *jsp, JsonbValue *jb, JsonValueList *found)
JsonbValue * findJsonbValueFromContainer(JsonbContainer *container, uint32 flags, JsonbValue *key)
#define jspStrictAbsenseOfErrors(cxt)
#define CHECK_FOR_INTERRUPTS()
static JsonPathExecResult executeItemOptUnwrapResult(JsonPathExecContext *cxt, JsonPathItem *jsp, JsonbValue *jb, bool unwrap, JsonValueList *found)
static JsonPathExecResult executeNextItem(JsonPathExecContext *cxt, JsonPathItem *cur, JsonPathItem *next, JsonbValue *v, JsonValueList *found, bool copy)
#define PG_RETURN_JSONB_P(x)
void jspGetArg(JsonPathItem *v, JsonPathItem *a)
char * jspGetString(JsonPathItem *v, int32 *len)
static JsonbValue * JsonValueListHead(JsonValueList *jvl)
int32 date_cmp_timestamp_internal(DateADT dateVal, Timestamp dt2)
#define DirectFunctionCall2(func, arg1, arg2)
JsonbIteratorToken JsonbIteratorNext(JsonbIterator **it, JsonbValue *val, bool skipNested)
static int cmpDateToTimestamp(DateADT date1, Timestamp ts2, bool useTz)
static int JsonbArraySize(JsonbValue *jb)
List * list_delete_first(List *list)
static int cmpTimestampToTimestampTz(Timestamp ts1, TimestampTz tstz2, bool useTz)
#define SRF_RETURN_DONE(_funcctx)
static int cmp(const chr *x, const chr *y, size_t len)
#define PG_GETARG_JSONB_P(x)
#define DatumGetTimestamp(X)
Numeric jspGetNumeric(JsonPathItem *v)
#define SRF_FIRSTCALL_INIT()