89typedef JsonbValue *(*JsonPathGetVarCallback) (
void *
vars,
char *varName,
int varNameLen,
142#define jperIsError(jper) ((jper) == jperError)
219#define JSON_TABLE_EXEC_CONTEXT_MAGIC 418352867
236#define jspStrictAbsenceOfErrors(cxt) (!(cxt)->laxMode)
237#define jspAutoUnwrap(cxt) ((cxt)->laxMode)
238#define jspAutoWrap(cxt) ((cxt)->laxMode)
239#define jspIgnoreStructuralErrors(cxt) ((cxt)->ignoreStructuralErrors)
240#define jspThrowErrors(cxt) ((cxt)->throwErrors)
243#define RETURN_ERROR(throw_error) \
245 if (jspThrowErrors(cxt)) \
260 Jsonb *json,
bool throwErrors,
284 bool ignoreStructuralErrors,
bool unwrapNext);
349 bool useTz,
bool *cast_error);
363 Oid typid,
int32 typmod,
bool *isnull);
374 .SetNamespace = NULL,
375 .SetRowFilter = NULL,
376 .SetColumnFilter = NULL,
413 jb, !silent, NULL, tz);
470 jb, !silent, &found, tz);
488 (
errcode(ERRCODE_SINGLETON_SQL_JSON_ITEM_REQUIRED),
489 errmsg(
"single boolean result is expected")));
550 jb, !silent, &found, tz);
599 jb, !silent, &found, tz);
632 jb, !silent, &found, tz);
777 v = hasNext ? &vbuf :
palloc(
sizeof(*v));
848 (
errcode(ERRCODE_SQL_JSON_ARRAY_NOT_FOUND),
849 errmsg(
"jsonpath wildcard array accessor can only be applied to an array"))));
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"))));
882 bool singleton =
size < 0;
913 index_to = index_from;
917 index_from > index_to ||
920 (
errcode(ERRCODE_INVALID_SQL_JSON_SUBSCRIPT),
921 errmsg(
"jsonpath array subscript is out of bounds"))));
926 if (index_to >=
size)
952 if (!hasNext && !found)
977 (
errcode(ERRCODE_SQL_JSON_ARRAY_NOT_FOUND),
978 errmsg(
"jsonpath array accessor can only be applied to an array"))));
989 bool savedIgnoreStructuralErrors;
1003 (cxt, hasNext ? &elem : NULL,
1004 jb->
val.binary.data, found,
1041 (
errcode(ERRCODE_SQL_JSON_MEMBER_NOT_FOUND), \
1042 errmsg(
"JSON object does not contain key \"%s\"",
1044 key.val.string.len))));
1053 (
errcode(ERRCODE_SQL_JSON_MEMBER_NOT_FOUND),
1054 errmsg(
"jsonpath member accessor can only be applied to an object"))));
1094 jbv->
val.string.len = strlen(jbv->
val.string.val);
1111 (
errcode(ERRCODE_SQL_JSON_ARRAY_NOT_FOUND),
1112 errmsg(
"jsonpath item method .%s() can only be applied to an array",
1120 jb =
palloc(
sizeof(*jb));
1160 (
Node *) &escontext);
1164 (
errcode(ERRCODE_NON_NUMERIC_SQL_JSON_ITEM),
1165 errmsg(
"argument \"%s\" of jsonpath item method .%s() is invalid for type %s",
1167 if (isinf(
val) || isnan(
val))
1169 (
errcode(ERRCODE_NON_NUMERIC_SQL_JSON_ITEM),
1170 errmsg(
"NaN or Infinity is not allowed for jsonpath item method .%s()",
1179 jb->
val.string.len);
1186 (
Node *) &escontext);
1190 (
errcode(ERRCODE_NON_NUMERIC_SQL_JSON_ITEM),
1191 errmsg(
"argument \"%s\" of jsonpath item method .%s() is invalid for type %s",
1193 if (isinf(
val) || isnan(
val))
1195 (
errcode(ERRCODE_NON_NUMERIC_SQL_JSON_ITEM),
1196 errmsg(
"NaN or Infinity is not allowed for jsonpath item method .%s()",
1208 (
errcode(ERRCODE_NON_NUMERIC_SQL_JSON_ITEM),
1209 errmsg(
"jsonpath item method .%s() can only be applied to a string or numeric value",
1241 elog(
ERROR,
"evaluating jsonpath LAST outside of array subscript");
1243 if (!hasNext && !found)
1251 lastjbv = hasNext ? &tmpjbv :
palloc(
sizeof(*lastjbv));
1257 lastjbv, found, hasNext);
1278 (
errcode(ERRCODE_NON_NUMERIC_SQL_JSON_ITEM),
1279 errmsg(
"argument \"%s\" of jsonpath item method .%s() is invalid for type %s",
1292 jb->
val.string.len);
1298 (
Node *) &escontext,
1303 (
errcode(ERRCODE_NON_NUMERIC_SQL_JSON_ITEM),
1304 errmsg(
"argument \"%s\" of jsonpath item method .%s() is invalid for type %s",
1311 (
errcode(ERRCODE_NON_NUMERIC_SQL_JSON_ITEM),
1312 errmsg(
"jsonpath item method .%s() can only be applied to a string or numeric value",
1335 bval = jb->
val.boolean;
1350 (
Node *) &escontext,
1355 (
errcode(ERRCODE_NON_NUMERIC_SQL_JSON_ITEM),
1356 errmsg(
"argument \"%s\" of jsonpath item method .%s() is invalid for type %s",
1371 jb->
val.string.len);
1375 (
errcode(ERRCODE_NON_NUMERIC_SQL_JSON_ITEM),
1376 errmsg(
"argument \"%s\" of jsonpath item method .%s() is invalid for type %s",
1384 (
errcode(ERRCODE_NON_NUMERIC_SQL_JSON_ITEM),
1385 errmsg(
"jsonpath item method .%s() can only be applied to a boolean, string, or numeric value",
1390 jb->
val.boolean = bval;
1401 char *numstr = NULL;
1409 num = jb->
val.numeric;
1412 (
errcode(ERRCODE_NON_NUMERIC_SQL_JSON_ITEM),
1413 errmsg(
"NaN or Infinity is not allowed for jsonpath item method .%s()",
1432 (
Node *) &escontext,
1437 (
errcode(ERRCODE_NON_NUMERIC_SQL_JSON_ITEM),
1438 errmsg(
"argument \"%s\" of jsonpath item method .%s() is invalid for type %s",
1444 (
errcode(ERRCODE_NON_NUMERIC_SQL_JSON_ITEM),
1445 errmsg(
"NaN or Infinity is not allowed for jsonpath item method .%s()",
1453 (
errcode(ERRCODE_NON_NUMERIC_SQL_JSON_ITEM),
1454 errmsg(
"jsonpath item method .%s() can only be applied to a string or numeric value",
1479 elog(
ERROR,
"invalid jsonpath item type for .decimal() precision");
1485 (
errcode(ERRCODE_NON_NUMERIC_SQL_JSON_ITEM),
1486 errmsg(
"precision of jsonpath item method .%s() is out of range for type integer",
1493 elog(
ERROR,
"invalid jsonpath item type for .decimal() scale");
1499 (
errcode(ERRCODE_NON_NUMERIC_SQL_JSON_ITEM),
1500 errmsg(
"scale of jsonpath item method .%s() is out of range for type integer",
1521 (
Node *) &escontext,
1526 (
errcode(ERRCODE_NON_NUMERIC_SQL_JSON_ITEM),
1527 errmsg(
"argument \"%s\" of jsonpath item method .%s() is invalid for type %s",
1536 jb->
val.numeric = num;
1559 (
errcode(ERRCODE_NON_NUMERIC_SQL_JSON_ITEM),
1560 errmsg(
"argument \"%s\" of jsonpath item method .%s() is invalid for type %s",
1572 jb->
val.string.len);
1578 (
Node *) &escontext,
1583 (
errcode(ERRCODE_NON_NUMERIC_SQL_JSON_ITEM),
1584 errmsg(
"argument \"%s\" of jsonpath item method .%s() is invalid for type %s",
1591 (
errcode(ERRCODE_NON_NUMERIC_SQL_JSON_ITEM),
1592 errmsg(
"jsonpath item method .%s() can only be applied to a string or numeric value",
1621 jb->
val.string.len);
1628 tmp = (jb->
val.boolean) ?
"true" :
"false";
1635 jb->
val.datetime.value,
1636 jb->
val.datetime.typid,
1637 &jb->
val.datetime.tz);
1646 (
errcode(ERRCODE_NON_NUMERIC_SQL_JSON_ITEM),
1647 errmsg(
"jsonpath item method .%s() can only be applied to a boolean, string, numeric, or datetime value",
1654 jb->
val.string.val = tmp;
1655 jb->
val.string.len = strlen(jb->
val.string.val);
1663 elog(
ERROR,
"unrecognized jsonpath item type: %d", jsp->
type);
1675 bool unwrapElements)
1680 elog(
ERROR,
"invalid jsonb array value type: %d", jb->
type);
1684 (cxt, jsp, jb->
val.binary.data, found, 1, 1, 1,
1685 false, unwrapElements);
1701 hasNext =
next != NULL;
1788 elog(
ERROR,
"boolean jsonpath item cannot have next item");
1902 elog(
ERROR,
"invalid boolean jsonpath item type: %d", jsp->
type);
1935 bool ignoreStructuralErrors,
bool unwrapNext)
1963 if (level >= first ||
1970 if (ignoreStructuralErrors)
1972 bool savedIgnoreStructuralErrors;
1997 (cxt, jsp, v.
val.binary.data, found,
1998 level + 1, first, last,
1999 ignoreStructuralErrors, unwrapNext);
2046 unwrapRightArg, &rseq);
2065 while (rarg ? (rval != NULL) : first)
2135 (
errcode(ERRCODE_SINGLETON_SQL_JSON_ITEM_REQUIRED),
2136 errmsg(
"left operand of jsonpath operator %s is not a single numeric value",
2142 (
errcode(ERRCODE_SINGLETON_SQL_JSON_ITEM_REQUIRED),
2143 errmsg(
"right operand of jsonpath operator %s is not a single numeric value",
2148 res = func(lval->
val.numeric, rval->
val.numeric, NULL);
2163 lval =
palloc(
sizeof(*lval));
2201 if (!found && !hasNext)
2206 if (!found && !hasNext)
2210 (
errcode(ERRCODE_SQL_JSON_NUMBER_NOT_FOUND),
2211 errmsg(
"operand of unary jsonpath operator %s is not a numeric value",
2251 if (whole->
val.string.len >= initial->
val.string.len &&
2252 !memcmp(whole->
val.string.val,
2253 initial->
val.string.val,
2254 initial->
val.string.len))
2285 str->val.string.len,
2286 cxt->
cflags, DEFAULT_COLLATION_OID, 0, NULL))
2309 (
errcode(ERRCODE_NON_NUMERIC_SQL_JSON_ITEM),
2310 errmsg(
"jsonpath item method .%s() can only be applied to a numeric value",
2318 jb =
palloc(
sizeof(*jb));
2351 int32 time_precision = -1;
2355 (
errcode(ERRCODE_INVALID_ARGUMENT_FOR_SQL_JSON_DATETIME_FUNCTION),
2356 errmsg(
"jsonpath item method .%s() can only be applied to a string",
2360 jb->
val.string.len);
2367 collid = DEFAULT_COLLATION_OID;
2383 elog(
ERROR,
"invalid jsonpath item type for .datetime() argument");
2391 &typid, &typmod, &tz,
2408 static const char *fmt_str[] =
2415 "yyyy-mm-dd HH24:MI:SS.USTZ",
2416 "yyyy-mm-dd HH24:MI:SSTZ",
2417 "yyyy-mm-dd\"T\"HH24:MI:SS.USTZ",
2418 "yyyy-mm-dd\"T\"HH24:MI:SSTZ",
2419 "yyyy-mm-dd HH24:MI:SS.US",
2420 "yyyy-mm-dd HH24:MI:SS",
2421 "yyyy-mm-dd\"T\"HH24:MI:SS.US",
2422 "yyyy-mm-dd\"T\"HH24:MI:SS"
2441 elog(
ERROR,
"invalid jsonpath item type for %s argument",
2448 (
errcode(ERRCODE_INVALID_ARGUMENT_FOR_SQL_JSON_DATETIME_FUNCTION),
2449 errmsg(
"time precision of jsonpath item method .%s() is out of range for type integer",
2468 &typid, &typmod, &tz,
2469 (
Node *) &escontext);
2482 (
errcode(ERRCODE_INVALID_ARGUMENT_FOR_SQL_JSON_DATETIME_FUNCTION),
2483 errmsg(
"%s format is not recognized: \"%s\"",
2485 errhint(
"Use a datetime template argument to specify the input data format."))));
2488 (
errcode(ERRCODE_INVALID_ARGUMENT_FOR_SQL_JSON_DATETIME_FUNCTION),
2489 errmsg(
"%s format is not recognized: \"%s\"",
2515 (
errcode(ERRCODE_INVALID_ARGUMENT_FOR_SQL_JSON_DATETIME_FUNCTION),
2516 errmsg(
"%s format is not recognized: \"%s\"",
2523 case TIMESTAMPTZOID:
2525 "timestamptz",
"date");
2530 elog(
ERROR,
"type with oid %u not supported", typid);
2543 (
errcode(ERRCODE_INVALID_ARGUMENT_FOR_SQL_JSON_DATETIME_FUNCTION),
2544 errmsg(
"%s format is not recognized: \"%s\"",
2559 case TIMESTAMPTZOID:
2561 "timestamptz",
"time");
2566 elog(
ERROR,
"type with oid %u not supported", typid);
2570 if (time_precision != -1)
2582 typmod = time_precision;
2596 (
errcode(ERRCODE_INVALID_ARGUMENT_FOR_SQL_JSON_DATETIME_FUNCTION),
2597 errmsg(
"%s format is not recognized: \"%s\"",
2608 case TIMESTAMPTZOID:
2613 elog(
ERROR,
"type with oid %u not supported", typid);
2617 if (time_precision != -1)
2629 typmod = time_precision;
2647 (
errcode(ERRCODE_INVALID_ARGUMENT_FOR_SQL_JSON_DATETIME_FUNCTION),
2648 errmsg(
"%s format is not recognized: \"%s\"",
2653 case TIMESTAMPTZOID:
2655 "timestamptz",
"timestamp");
2660 elog(
ERROR,
"type with oid %u not supported", typid);
2664 if (time_precision != -1)
2674 (
Node *) &escontext);
2677 (
errcode(ERRCODE_INVALID_ARGUMENT_FOR_SQL_JSON_DATETIME_FUNCTION),
2678 errmsg(
"time precision of jsonpath item method .%s() is invalid",
2683 typmod = time_precision;
2686 typid = TIMESTAMPOID;
2699 "date",
"timestamptz");
2718 (
errcode(ERRCODE_INVALID_ARGUMENT_FOR_SQL_JSON_DATETIME_FUNCTION),
2719 errmsg(
"%s format is not recognized: \"%s\"",
2724 "timestamp",
"timestamptz");
2731 &fsec, NULL, NULL) == 0)
2738 case TIMESTAMPTZOID:
2741 elog(
ERROR,
"type with oid %u not supported", typid);
2745 if (time_precision != -1)
2755 (
Node *) &escontext);
2758 (
errcode(ERRCODE_INVALID_ARGUMENT_FOR_SQL_JSON_DATETIME_FUNCTION),
2759 errmsg(
"time precision of jsonpath item method .%s() is invalid",
2764 typmod = time_precision;
2767 typid = TIMESTAMPTZOID;
2771 elog(
ERROR,
"unrecognized jsonpath item type: %d", jsp->
type);
2781 if (!hasNext && !found)
2784 jb = hasNext ? &jbvbuf :
palloc(
sizeof(*jb));
2788 jb->
val.datetime.typid = typid;
2789 jb->
val.datetime.typmod = typmod;
2790 jb->
val.datetime.tz = tz;
2838 (
errcode(ERRCODE_SQL_JSON_OBJECT_NOT_FOUND),
2839 errmsg(
"jsonpath item method .%s() can only be applied to an object",
2842 jbc = jb->
val.binary.data;
2850 keystr.
val.string.val =
"key";
2851 keystr.
val.string.len = 3;
2854 valstr.
val.string.val =
"value";
2855 valstr.
val.string.len = 5;
2858 idstr.
val.string.val =
"id";
2859 idstr.
val.string.len = 2;
2884 if (!hasNext && !found)
2976 &
value->val.string.len);
2982 elog(
ERROR,
"unexpected jsonpath item type");
3003 if (curvar->
namelen == varNameLen &&
3004 strncmp(curvar->
name, varName, varNameLen) == 0)
3028 *baseObject = *result;
3084 case TIMESTAMPTZOID:
3086 res->val.datetime.value =
val;
3087 res->val.datetime.typid = typid;
3088 res->val.datetime.typmod = typmod;
3089 res->val.datetime.tz = 0;
3122 errcode(ERRCODE_INVALID_PARAMETER_VALUE),
3123 errmsg(
"could not convert value of type %s to jsonpath",
3152 if (cxt->
vars == NULL ||
3153 (v = cxt->
getVar(cxt->
vars, varName, varNameLength,
3154 &baseObject, &baseObjectId)) == NULL)
3156 (
errcode(ERRCODE_UNDEFINED_OBJECT),
3157 errmsg(
"could not find jsonpath variable \"%s\"",
3158 pnstrdup(varName, varNameLength))));
3160 if (baseObjectId > 0)
3180 tmp.
val.string.val = varName;
3181 tmp.
val.string.len = varNameLength;
3209 errcode(ERRCODE_INVALID_PARAMETER_VALUE),
3210 errmsg(
"\"vars\" argument is not an object"),
3211 errdetail(
"Jsonpath parameters should be encoded as key-value pairs of \"vars\" object."));
3215 return vars != NULL ? 1 : 0;
3253 const char *
s2,
int len2)
3265 return len1 < len2 ? -1 : 1;
3274 const char *mbstr2,
int mblen2)
3302 utf8len1 = (mbstr1 == utf8str1) ? mblen1 : strlen(utf8str1);
3303 utf8len2 = (mbstr2 == utf8str2) ? mblen2 : strlen(utf8str2);
3311 if (mbstr1 == utf8str1 && mbstr2 == utf8str2)
3315 if (mbstr1 != utf8str1)
3317 if (mbstr2 != utf8str2)
3365 cmp = jb1->
val.boolean == jb2->
val.boolean ? 0 :
3366 jb1->
val.boolean ? 1 : -1;
3373 return jb1->
val.string.len != jb2->
val.string.len ||
3374 memcmp(jb1->
val.string.val,
3375 jb2->
val.string.val,
3379 jb2->
val.string.val, jb2->
val.string.len);
3386 jb1->
val.datetime.typid,
3387 jb2->
val.datetime.value,
3388 jb2->
val.datetime.typid,
3427 elog(
ERROR,
"unrecognized jsonpath operation: %d", op);
3464 Datum numeric_index;
3465 bool have_error =
false;
3473 (
errcode(ERRCODE_INVALID_SQL_JSON_SUBSCRIPT),
3474 errmsg(
"jsonpath array subscript is not a single numeric value"))));
3485 (
errcode(ERRCODE_INVALID_SQL_JSON_SUBSCRIPT),
3486 errmsg(
"jsonpath array subscript is out of integer range"))));
3519 else if (!jvl->
list)
3603 jbv->
val.binary.data = &jb->
root;
3643 return scalar->
type ==
type ? scalar : NULL;
3669 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
3670 errmsg(
"cannot convert value from %s to %s without time zone usage",
3672 errhint(
"Use *_tz() function for time zone support.")));
3723 bool useTz,
bool *cast_error)
3727 *cast_error =
false;
3744 case TIMESTAMPTZOID:
3755 elog(
ERROR,
"unrecognized SQL/JSON datetime type oid: %u",
3776 case TIMESTAMPTZOID:
3781 elog(
ERROR,
"unrecognized SQL/JSON datetime type oid: %u",
3802 case TIMESTAMPTZOID:
3807 elog(
ERROR,
"unrecognized SQL/JSON datetime type oid: %u",
3825 case TIMESTAMPTZOID:
3836 elog(
ERROR,
"unrecognized SQL/JSON datetime type oid: %u",
3841 case TIMESTAMPTZOID:
3854 case TIMESTAMPTZOID:
3865 elog(
ERROR,
"unrecognized SQL/JSON datetime type oid: %u",
3871 elog(
ERROR,
"unrecognized SQL/JSON datetime type oid: %u", typid1);
3912 const char *column_name)
3951 if (singleton == NULL)
3961 elog(
ERROR,
"unrecognized json wrapper %d", (
int) wrapper);
3979 (
errcode(ERRCODE_MORE_THAN_ONE_SQL_JSON_ITEM),
3980 errmsg(
"JSON path expression for column \"%s\" should return single item without wrapper",
3982 errhint(
"Use the WITH WRAPPER clause to wrap SQL/JSON items into an array.")));
3985 (
errcode(ERRCODE_MORE_THAN_ONE_SQL_JSON_ITEM),
3986 errmsg(
"JSON path expression in JSON_QUERY should return single item without wrapper"),
3987 errhint(
"Use the WITH WRAPPER clause to wrap SQL/JSON items into an array.")));
4005 const char *column_name)
4014 !
error, &found,
true);
4027 *empty = (count == 0);
4043 (
errcode(ERRCODE_MORE_THAN_ONE_SQL_JSON_ITEM),
4044 errmsg(
"JSON path expression for column \"%s\" should return single scalar item",
4048 (
errcode(ERRCODE_MORE_THAN_ONE_SQL_JSON_ITEM),
4049 errmsg(
"JSON path expression in JSON_VALUE should return single scalar item")));
4067 (
errcode(ERRCODE_SQL_JSON_SCALAR_REQUIRED),
4068 errmsg(
"JSON path expression for column \"%s\" should return single scalar item",
4072 (
errcode(ERRCODE_SQL_JSON_SCALAR_REQUIRED),
4073 errmsg(
"JSON path expression in JSON_VALUE should return single scalar item")));
4094 elog(
ERROR,
"%s called with invalid TableFuncScanState", fname);
4097 elog(
ERROR,
"%s called with invalid TableFuncScanState", fname);
4127 if (
state->passingvalexprs)
4135 namelc, je->passing_names)
4167 state->opaque = cxt;
4183 state->opaque = NULL;
4199 planstate->
parent = parentstate;
4215 for (
i = scan->
colMin;
i >= 0 && i <= scan->colMax;
i++)
4299 elog(
ERROR,
"invalid JsonTablePlan %d", (
int) planstate->
plan->type);
4454 Oid typid,
int32 typmod,
bool *isnull)
ArrayType * construct_array_builtin(Datum *elems, int nelems, Oid elmtype)
int DetermineTimeZoneOffset(struct pg_tm *tm, pg_tz *tzp)
void j2date(int jd, int *year, int *month, int *day)
int32 numeric_int4_opt_error(Numeric num, bool *have_error)
Datum float8_numeric(PG_FUNCTION_ARGS)
Datum numeric_cmp(PG_FUNCTION_ARGS)
Numeric numeric_mod_opt_error(Numeric num1, Numeric num2, bool *have_error)
Numeric numeric_div_opt_error(Numeric num1, Numeric num2, bool *have_error)
Numeric int64_to_numeric(int64 val)
Datum float4_numeric(PG_FUNCTION_ARGS)
Datum int4_numeric(PG_FUNCTION_ARGS)
Datum numeric_uminus(PG_FUNCTION_ARGS)
Datum numeric_ceil(PG_FUNCTION_ARGS)
Datum numerictypmodin(PG_FUNCTION_ARGS)
Datum numeric_out(PG_FUNCTION_ARGS)
int64 numeric_int8_opt_error(Numeric num, bool *have_error)
Datum numeric_trunc(PG_FUNCTION_ARGS)
Datum numeric_in(PG_FUNCTION_ARGS)
bool numeric_is_nan(Numeric num)
Numeric numeric_sub_opt_error(Numeric num1, Numeric num2, bool *have_error)
Numeric numeric_mul_opt_error(Numeric num1, Numeric num2, bool *have_error)
Datum int2_numeric(PG_FUNCTION_ARGS)
Datum numeric_abs(PG_FUNCTION_ARGS)
Datum int8_numeric(PG_FUNCTION_ARGS)
Numeric numeric_add_opt_error(Numeric num1, Numeric num2, bool *have_error)
bool numeric_is_inf(Numeric num)
Datum numeric_floor(PG_FUNCTION_ARGS)
Datum timestamp_cmp(PG_FUNCTION_ARGS)
bool AdjustTimestampForTypmod(Timestamp *time, int32 typmod, Node *escontext)
Datum timestamp_timestamptz(PG_FUNCTION_ARGS)
int32 timestamp_cmp_timestamptz_internal(Timestamp timestampVal, TimestampTz dt2)
int timestamp2tm(Timestamp dt, int *tzp, struct pg_tm *tm, fsec_t *fsec, const char **tzn, pg_tz *attimezone)
int32 anytimestamp_typmod_check(bool istz, int32 typmod)
Datum timestamptz_timestamp(PG_FUNCTION_ARGS)
bool parse_bool(const char *value, bool *result)
#define PG_USED_FOR_ASSERTS_ONLY
#define Assert(condition)
#define POSTGRES_EPOCH_JDATE
int32 date_cmp_timestamp_internal(DateADT dateVal, Timestamp dt2)
Datum date_cmp(PG_FUNCTION_ARGS)
Datum time_cmp(PG_FUNCTION_ARGS)
Datum timestamp_time(PG_FUNCTION_ARGS)
int32 anytime_typmod_check(bool istz, int32 typmod)
Datum date_timestamptz(PG_FUNCTION_ARGS)
Datum timetz_cmp(PG_FUNCTION_ARGS)
Datum timetz_time(PG_FUNCTION_ARGS)
Datum time_timetz(PG_FUNCTION_ARGS)
Datum timestamptz_timetz(PG_FUNCTION_ARGS)
void AdjustTimeForTypmod(TimeADT *time, int32 typmod)
Datum timestamptz_date(PG_FUNCTION_ARGS)
Datum timestamp_date(PG_FUNCTION_ARGS)
int32 date_cmp_timestamptz_internal(DateADT dateVal, TimestampTz dt2)
Datum timestamptz_time(PG_FUNCTION_ARGS)
Datum date_timestamp(PG_FUNCTION_ARGS)
static TimeTzADT * DatumGetTimeTzADTP(Datum X)
static DateADT DatumGetDateADT(Datum X)
static TimeADT DatumGetTimeADT(Datum X)
static Datum TimeTzADTPGetDatum(const TimeTzADT *X)
static Datum TimeADTGetDatum(TimeADT X)
static void PGresult * res
int errdetail(const char *fmt,...)
int errhint(const char *fmt,...)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
static Datum ExecEvalExpr(ExprState *state, ExprContext *econtext, bool *isNull)
float8 float8in_internal(char *num, char **endptr_p, const char *type_name, const char *orig_string, struct Node *escontext)
Datum Int64GetDatum(int64 X)
Datum Float8GetDatum(float8 X)
bool DirectInputFunctionCallSafe(PGFunction func, char *str, Oid typioparam, int32 typmod, fmNodePtr escontext, Datum *result)
#define PG_FREE_IF_COPY(ptr, n)
#define DirectFunctionCall2(func, arg1, arg2)
#define DirectFunctionCall1(func, arg1)
#define PG_GETARG_BOOL(n)
Datum(* PGFunction)(FunctionCallInfo fcinfo)
#define PG_RETURN_BOOL(x)
#define SRF_IS_FIRSTCALL()
#define SRF_PERCALL_SETUP()
#define SRF_RETURN_NEXT(_funcctx, _result)
#define SRF_FIRSTCALL_INIT()
#define SRF_RETURN_DONE(_funcctx)
Datum int8in(PG_FUNCTION_ARGS)
Datum int4in(PG_FUNCTION_ARGS)
if(TABLE==NULL||TABLE_index==NULL)
char * JsonEncodeDateTime(char *buf, Datum value, Oid typid, const int *tzp)
Datum jsonb_in(PG_FUNCTION_ARGS)
const char * JsonbTypeName(JsonbValue *val)
bool JsonbExtractScalar(JsonbContainer *jbc, JsonbValue *res)
#define JsonContainerIsScalar(jc)
#define JsonContainerIsArray(jc)
#define JsonContainerSize(jc)
#define PG_GETARG_JSONB_P_COPY(x)
static Datum JsonbPGetDatum(const Jsonb *p)
#define IsAJsonbScalar(jsonbval)
#define PG_RETURN_JSONB_P(x)
#define PG_GETARG_JSONB_P(x)
#define JsonContainerIsObject(jc)
static Jsonb * DatumGetJsonbP(Datum d)
JsonbValue * pushJsonbValue(JsonbParseState **pstate, JsonbIteratorToken seq, JsonbValue *jbval)
JsonbIterator * JsonbIteratorInit(JsonbContainer *container)
JsonbValue * findJsonbValueFromContainer(JsonbContainer *container, uint32 flags, JsonbValue *key)
JsonbIteratorToken JsonbIteratorNext(JsonbIterator **it, JsonbValue *val, bool skipNested)
JsonbValue * getIthJsonbValueFromContainer(JsonbContainer *container, uint32 i)
Jsonb * JsonbValueToJsonb(JsonbValue *val)
void jspGetLeftArg(JsonPathItem *v, JsonPathItem *a)
void jspGetArg(JsonPathItem *v, JsonPathItem *a)
void jspInitByBuffer(JsonPathItem *v, char *base, int32 pos)
bool jspGetBool(JsonPathItem *v)
void jspInit(JsonPathItem *v, JsonPath *js)
char * jspGetString(JsonPathItem *v, int32 *len)
Numeric jspGetNumeric(JsonPathItem *v)
bool jspGetArraySubscript(JsonPathItem *v, JsonPathItem *from, JsonPathItem *to, int i)
const char * jspOperationName(JsonPathItemType type)
bool jspGetNext(JsonPathItem *v, JsonPathItem *a)
void jspGetRightArg(JsonPathItem *v, JsonPathItem *a)
bool jspConvertRegexFlags(uint32 xflags, int *result, struct Node *escontext)
#define PG_GETARG_JSONPATH_P(x)
#define PG_GETARG_JSONPATH_P_COPY(x)
static JsonPath * DatumGetJsonPathP(Datum d)