|
PostgreSQL Source Code git master
|
#include "postgres.h"#include "catalog/pg_collation.h"#include "catalog/pg_type.h"#include "funcapi.h"#include "miscadmin.h"#include "nodes/miscnodes.h"#include "nodes/nodeFuncs.h"#include "regex/regex.h"#include "utils/builtins.h"#include "utils/date.h"#include "utils/datetime.h"#include "utils/float.h"#include "utils/formatting.h"#include "utils/json.h"#include "utils/jsonpath.h"#include "utils/memutils.h"#include "utils/timestamp.h"
Go to the source code of this file.
Data Structures | |
| struct | JsonBaseObjectInfo |
| struct | JsonPathExecContext |
| struct | JsonLikeRegexContext |
| struct | JsonValueList |
| struct | JsonValueListIterator |
| struct | JsonTablePlanRowSource |
| struct | JsonTablePlanState |
| struct | JsonTableExecContext |
Macros | |
| #define | jperIsError(jper) ((jper) == jperError) |
| #define | JSON_TABLE_EXEC_CONTEXT_MAGIC 418352867 |
| #define | jspStrictAbsenceOfErrors(cxt) (!(cxt)->laxMode) |
| #define | jspAutoUnwrap(cxt) ((cxt)->laxMode) |
| #define | jspAutoWrap(cxt) ((cxt)->laxMode) |
| #define | jspIgnoreStructuralErrors(cxt) ((cxt)->ignoreStructuralErrors) |
| #define | jspThrowErrors(cxt) ((cxt)->throwErrors) |
| #define | RETURN_ERROR(throw_error) |
Enumerations | |
| enum | JsonPathBool { jpbFalse = 0 , jpbTrue = 1 , jpbUnknown = 2 } |
| enum | JsonPathExecResult { jperOk = 0 , jperNotFound = 1 , jperError = 2 } |
Variables | |
| const TableFuncRoutine | JsonbTableRoutine |
| #define JSON_TABLE_EXEC_CONTEXT_MAGIC 418352867 |
Definition at line 219 of file jsonpath_exec.c.
| #define jspAutoUnwrap | ( | cxt | ) | ((cxt)->laxMode) |
Definition at line 237 of file jsonpath_exec.c.
| #define jspAutoWrap | ( | cxt | ) | ((cxt)->laxMode) |
Definition at line 238 of file jsonpath_exec.c.
| #define jspIgnoreStructuralErrors | ( | cxt | ) | ((cxt)->ignoreStructuralErrors) |
Definition at line 239 of file jsonpath_exec.c.
| #define jspStrictAbsenceOfErrors | ( | cxt | ) | (!(cxt)->laxMode) |
Definition at line 236 of file jsonpath_exec.c.
| #define jspThrowErrors | ( | cxt | ) | ((cxt)->throwErrors) |
Definition at line 240 of file jsonpath_exec.c.
| #define RETURN_ERROR | ( | throw_error | ) |
Definition at line 243 of file jsonpath_exec.c.
Definition at line 255 of file jsonpath_exec.c.
Definition at line 91 of file jsonpath_exec.c.
| typedef JsonbValue *(* JsonPathGetVarCallback) (void *vars, char *varName, int varNameLen, JsonbValue *baseObject, int *baseObjectId) |
Definition at line 89 of file jsonpath_exec.c.
| typedef JsonPathBool(* JsonPathPredicateCallback) (JsonPathItem *jsp, JsonbValue *larg, JsonbValue *rarg, void *param) |
Definition at line 251 of file jsonpath_exec.c.
| Enumerator | |
|---|---|
| jpbFalse | |
| jpbTrue | |
| jpbUnknown | |
Definition at line 127 of file jsonpath_exec.c.
| Enumerator | |
|---|---|
| jperOk | |
| jperNotFound | |
| jperError | |
Definition at line 135 of file jsonpath_exec.c.
|
static |
Definition at line 2931 of file jsonpath_exec.c.
References executeNextItem(), fb(), jbvBool, jbvNull, jpbTrue, jpbUnknown, jperOk, jspGetNext(), next, and JsonbValue::type.
Referenced by executeItemOptUnwrapTarget().
Definition at line 3254 of file jsonpath_exec.c.
References cmp(), fb(), Min, s1, and s2.
Referenced by compareStrings().
Definition at line 3681 of file jsonpath_exec.c.
References checkTimezoneIsUsedForCast(), DirectFunctionCall1, and time_timetz().
Referenced by compareDatetime().
|
static |
Definition at line 3669 of file jsonpath_exec.c.
References ereport, errcode(), errhint(), errmsg(), ERROR, and fb().
Referenced by castTimeToTimeTz(), cmpDateToTimestampTz(), cmpTimestampToTimestampTz(), and executeDateTimeMethod().
Definition at line 3693 of file jsonpath_exec.c.
References date_cmp_timestamp_internal(), and fb().
Referenced by compareDatetime().
|
static |
Definition at line 3702 of file jsonpath_exec.c.
References checkTimezoneIsUsedForCast(), date_cmp_timestamptz_internal(), and fb().
Referenced by compareDatetime().
|
static |
Definition at line 3713 of file jsonpath_exec.c.
References checkTimezoneIsUsedForCast(), fb(), and timestamp_cmp_timestamptz_internal().
Referenced by compareDatetime().
|
static |
Definition at line 3726 of file jsonpath_exec.c.
References castTimeToTimeTz(), cmpDateToTimestamp(), cmpDateToTimestampTz(), cmpTimestampToTimestampTz(), date_cmp(), DatumGetDateADT(), DatumGetInt32(), DatumGetTimestamp(), DatumGetTimestampTz(), DirectFunctionCall2, elog, ERROR, fb(), time_cmp(), timestamp_cmp(), and timetz_cmp().
Referenced by compareItems().
|
static |
Definition at line 3342 of file jsonpath_exec.c.
References cmp(), compareDatetime(), compareNumeric(), compareStrings(), elog, ERROR, fb(), jbvArray, jbvBinary, jbvBool, jbvDatetime, jbvNull, jbvNumeric, jbvObject, jbvString, jpbFalse, jpbTrue, jpbUnknown, jpiEqual, jpiGreater, jpiGreaterOrEqual, jpiLess, jpiLessOrEqual, and jpiNotEqual.
Referenced by executeComparison().
Definition at line 3438 of file jsonpath_exec.c.
References a, b, DatumGetInt32(), DirectFunctionCall2, numeric_cmp(), and NumericGetDatum().
Referenced by compareItems().
|
static |
Definition at line 3275 of file jsonpath_exec.c.
References binaryCompareStrings(), cmp(), fb(), GetDatabaseEncoding(), pfree(), pg_server_to_any(), PG_SQL_ASCII, and PG_UTF8.
Referenced by compareItems().
|
static |
Definition at line 3446 of file jsonpath_exec.c.
References fb(), and palloc_object.
Referenced by executeAnyItem(), and executeNextItem().
Definition at line 3037 of file jsonpath_exec.c.
References list_length().
Referenced by JsonPathExists(), JsonPathQuery(), JsonPathValue(), and JsonTableResetRowPattern().
Definition at line 3204 of file jsonpath_exec.c.
References ereport, errcode(), errdetail(), errmsg(), ERROR, fb(), and JsonContainerIsObject.
Referenced by jsonb_path_exists_internal(), jsonb_path_match_internal(), jsonb_path_query_array_internal(), jsonb_path_query_first_internal(), and jsonb_path_query_internal().
|
static |
Definition at line 1935 of file jsonpath_exec.c.
References Assert, check_stack_depth(), copyJsonbValue(), executeAnyItem(), executeItemOptUnwrapTarget(), fb(), JsonPathExecContext::ignoreStructuralErrors, jbvBinary, jperIsError, jperNotFound, jperOk, JsonbIteratorInit(), JsonbIteratorNext(), JsonValueListAppend(), PG_UINT32_MAX, JsonbValue::type, JsonbValue::val, WJB_DONE, WJB_ELEM, WJB_KEY, and WJB_VALUE.
Referenced by executeAnyItem(), executeItemOptUnwrapTarget(), and executeItemUnwrapTargetArray().
|
static |
Definition at line 2106 of file jsonpath_exec.c.
References ereport, errcode(), errmsg(), ERROR, ErrorSaveContext::error_occurred, executeItemOptUnwrapResult(), executeNextItem(), fb(), getScalar(), jbvNumeric, jperError, jperIsError, jperOk, JsonValueListHead(), JsonValueListLength(), jspGetLeftArg(), jspGetNext(), jspGetRightArg(), jspOperationName(), jspThrowErrors, palloc_object, RETURN_ERROR, JsonbValue::type, and JsonbValue::val.
Referenced by executeItemOptUnwrapTarget().
|
static |
Definition at line 1778 of file jsonpath_exec.c.
References JsonPathItem::base, check_stack_depth(), elog, ERROR, executeBoolItem(), executeComparison(), executeItemOptUnwrapResultNoThrow(), executeLikeRegex(), executePredicate(), executeStartsWith(), fb(), jpbFalse, jpbTrue, jpbUnknown, jperIsError, jperOk, jpiAnd, jpiEqual, jpiExists, jpiGreater, jpiGreaterOrEqual, jpiIsUnknown, jpiLess, jpiLessOrEqual, jpiLikeRegex, jpiNot, jpiNotEqual, jpiOr, jpiStartsWith, JsonValueListIsEmpty(), jspGetArg(), jspGetLeftArg(), jspGetRightArg(), jspHasNext, jspInitByBuffer(), and jspStrictAbsenceOfErrors.
Referenced by executeBoolItem(), executeItemOptUnwrapTarget(), and executeNestedBoolItem().
|
static |
Definition at line 3243 of file jsonpath_exec.c.
References cmp(), compareItems(), fb(), and JsonPathExecContext::useTz.
Referenced by executeBoolItem().
|
static |
Definition at line 2340 of file jsonpath_exec.c.
References AdjustTimeForTypmod(), AdjustTimestampForTypmod(), anytime_typmod_check(), anytimestamp_typmod_check(), checkTimezoneIsUsedForCast(), collid, cstring_to_text(), cstring_to_text_with_len(), date_timestamp(), date_timestamptz(), DatumGetDateADT(), DatumGetTimeADT(), DatumGetTimestamp(), DatumGetTimestampTz(), DatumGetTimeTzADTP(), DetermineTimeZoneOffset(), DirectFunctionCall1, elog, ereport, errcode(), errhint(), errmsg(), ERROR, ErrorSaveContext::error_occurred, executeNextItem(), fb(), getScalar(), i, j2date(), jbvDatetime, jbvString, jperError, jperIsError, jperNotFound, jperOk, jpiDate, jpiDatetime, jpiNumeric, jpiString, jpiTime, jpiTimestamp, jpiTimestampTz, jpiTimeTz, jspGetArg(), jspGetNext(), jspGetNumeric(), jspGetString(), jspOperationName(), jspThrowErrors, lengthof, MemoryContextSwitchTo(), numeric_int4_safe(), palloc_object, parse_datetime(), pfree(), POSTGRES_EPOCH_JDATE, RETURN_ERROR, session_timezone, text_to_cstring(), TimeTzADT::time, time_timetz(), TimeADTGetDatum(), timestamp2tm(), timestamp_date(), timestamp_time(), timestamp_timestamptz(), TimestampGetDatum(), timestamptz_date(), timestamptz_time(), timestamptz_timestamp(), timestamptz_timetz(), TimestampTzGetDatum(), timetz_time(), TimeTzADTPGetDatum(), tm, pg_tm::tm_hour, pg_tm::tm_mday, pg_tm::tm_min, pg_tm::tm_mon, pg_tm::tm_sec, pg_tm::tm_year, TopMemoryContext, JsonPathItem::type, JsonPathExecContext::useTz, and value.
Referenced by executeItemOptUnwrapTarget().
|
static |
Definition at line 734 of file jsonpath_exec.c.
References executeItemOptUnwrapTarget(), fb(), and jspAutoUnwrap.
Referenced by executeItemOptUnwrapResult(), executeJsonPath(), executeNextItem(), and getArrayIndex().
|
static |
Definition at line 1726 of file jsonpath_exec.c.
References Assert, executeItem(), executeItemUnwrapTargetArray(), fb(), jbvArray, jperIsError, jperOk, JsonbType(), JsonValueListAppend(), JsonValueListInitIterator(), JsonValueListNext(), jspAutoUnwrap, and JsonbValue::type.
Referenced by executeBinaryArithmExpr(), executeItemOptUnwrapResultNoThrow(), and executeUnaryArithmExpr().
|
static |
Definition at line 1761 of file jsonpath_exec.c.
References executeItemOptUnwrapResult(), fb(), and JsonPathExecContext::throwErrors.
Referenced by executeBoolItem(), and executePredicate().
|
static |
Definition at line 746 of file jsonpath_exec.c.
References appendBoolResult(), Assert, JsonPathExecContext::baseObject, buf, CHECK_FOR_INTERRUPTS, check_stack_depth(), construct_array_builtin(), CStringGetDatum(), JsonPathExecContext::current, DatumGetCString(), DatumGetInt32(), DatumGetNumeric(), DirectFunctionCall1, DirectInputFunctionCallSafe(), elog, ereport, errcode(), errmsg(), ERROR, ErrorSaveContext::error_occurred, executeAnyItem(), executeBinaryArithmExpr(), executeBoolItem(), executeDateTimeMethod(), executeItemUnwrapTargetArray(), executeKeyValueMethod(), executeNestedBoolItem(), executeNextItem(), executeNumericItemMethod(), executeUnaryArithmExpr(), fb(), findJsonbValueFromContainer(), float8_numeric(), Float8GetDatum(), float8in_internal(), getArrayIndex(), getIthJsonbValueFromContainer(), getJsonPathItem(), i, JsonPathExecContext::ignoreStructuralErrors, JsonPathExecContext::innermostArraySize, Int32GetDatum(), int4_numeric(), int4in(), int64_to_numeric(), Int64GetDatum(), int8_numeric(), int8in(), InvalidOid, JB_FOBJECT, jbvArray, jbvBinary, jbvBool, jbvDatetime, jbvNull, jbvNumeric, jbvObject, jbvString, jpbTrue, jperError, jperIsError, jperNotFound, jperOk, jpiAbs, jpiAdd, jpiAnd, jpiAny, jpiAnyArray, jpiAnyKey, jpiBigint, jpiBool, jpiBoolean, jpiCeiling, jpiCurrent, jpiDate, jpiDatetime, jpiDecimal, jpiDiv, jpiDouble, jpiEqual, jpiExists, jpiFilter, jpiFloor, jpiGreater, jpiGreaterOrEqual, jpiIndexArray, jpiInteger, jpiIsUnknown, jpiKey, jpiKeyValue, jpiLast, jpiLess, jpiLessOrEqual, jpiLikeRegex, jpiMinus, jpiMod, jpiMul, jpiNot, jpiNotEqual, jpiNull, jpiNumber, jpiNumeric, jpiOr, jpiPlus, jpiRoot, jpiSize, jpiStartsWith, jpiString, jpiStringFunc, jpiSub, jpiTime, jpiTimestamp, jpiTimestampTz, jpiTimeTz, jpiType, jpiVariable, JsonbArraySize(), JsonbType(), JsonbTypeName(), JsonEncodeDateTime(), jspAutoUnwrap, jspAutoWrap, jspGetArg(), jspGetArraySubscript(), jspGetLeftArg(), jspGetNext(), jspGetNumeric(), jspGetRightArg(), jspGetString(), jspHasNext, jspIgnoreStructuralErrors, jspOperationName(), jspThrowErrors, MAXDATELEN, numeric_abs(), numeric_add_safe(), numeric_ceil(), numeric_div_safe(), numeric_floor(), numeric_in(), numeric_int4_safe(), numeric_int8_safe(), numeric_is_inf(), numeric_is_nan(), numeric_mod_safe(), numeric_mul_safe(), numeric_out(), numeric_sub_safe(), numeric_uminus(), NumericGetDatum(), numerictypmodin(), palloc_object, parse_bool(), pfree(), pg_ltoa(), pnstrdup(), PointerGetDatum(), pstrdup(), range(), RETURN_ERROR, JsonPathExecContext::root, scale, setBaseObject(), JsonPathItem::type, and val.
Referenced by executeAnyItem(), and executeItem().
|
static |
Definition at line 1675 of file jsonpath_exec.c.
References Assert, elog, ERROR, executeAnyItem(), fb(), jbvArray, and jbvBinary.
Referenced by executeItemOptUnwrapResult(), executeItemOptUnwrapTarget(), and executeNumericItemMethod().
|
static |
Definition at line 678 of file jsonpath_exec.c.
References Assert, JsonPathExecContext::baseObject, JsonPathExecContext::current, executeItem(), fb(), JsonPathExecContext::getVar, JsonPath::header, JsonBaseObjectInfo::id, JsonPathExecContext::ignoreStructuralErrors, JsonPathExecContext::innermostArraySize, JsonBaseObjectInfo::jbc, jperIsError, jperNotFound, jperOk, JsonbExtractScalar(), JsonbInitBinary(), JSONPATH_LAX, JsonValueListIsEmpty(), jspInit(), jspStrictAbsenceOfErrors, JsonPathExecContext::lastGeneratedObjectId, JsonPathExecContext::laxMode, JsonPathExecContext::root, Jsonb::root, JsonPathExecContext::throwErrors, JsonPathExecContext::useTz, and JsonPathExecContext::vars.
Referenced by jsonb_path_exists_internal(), jsonb_path_match_internal(), jsonb_path_query_array_internal(), jsonb_path_query_first_internal(), jsonb_path_query_internal(), JsonPathExists(), JsonPathQuery(), JsonPathValue(), and JsonTableResetRowPattern().
|
static |
Definition at line 2821 of file jsonpath_exec.c.
References Assert, JsonPathExecContext::baseObject, ereport, errcode(), errmsg(), ERROR, executeNextItem(), fb(), JsonBaseObjectInfo::id, int64_to_numeric(), INT64CONST, JsonBaseObjectInfo::jbc, jbvBinary, jbvNumeric, jbvObject, jbvString, jperIsError, jperNotFound, jperOk, JsonbInitBinary(), JsonbIteratorInit(), JsonbIteratorNext(), JsonbType(), JsonbValueToJsonb(), JsonContainerSize, jspGetNext(), jspOperationName(), JsonPathExecContext::lastGeneratedObjectId, next, ps, pushJsonbValue(), RETURN_ERROR, setBaseObject(), val, WJB_BEGIN_OBJECT, WJB_DONE, WJB_END_OBJECT, WJB_KEY, and WJB_VALUE.
Referenced by executeItemOptUnwrapTarget().
|
static |
Definition at line 2268 of file jsonpath_exec.c.
References JsonLikeRegexContext::cflags, cstring_to_text_with_len(), fb(), getScalar(), jbvString, jpbFalse, jpbTrue, jpbUnknown, jspConvertRegexFlags(), RE_compile_and_execute(), JsonLikeRegexContext::regex, and str.
Referenced by executeBoolItem().
|
static |
Definition at line 1914 of file jsonpath_exec.c.
References JsonPathExecContext::current, executeBoolItem(), and fb().
Referenced by executeItemOptUnwrapTarget().
|
static |
Definition at line 1695 of file jsonpath_exec.c.
References copyJsonbValue(), cur, executeItem(), fb(), jperOk, JsonValueListAppend(), jspGetNext(), jspHasNext, and next.
Referenced by appendBoolResult(), executeBinaryArithmExpr(), executeDateTimeMethod(), executeItemOptUnwrapTarget(), executeKeyValueMethod(), executeNumericItemMethod(), and executeUnaryArithmExpr().
|
static |
Definition at line 2299 of file jsonpath_exec.c.
References DatumGetNumeric(), DirectFunctionCall1, ereport, errcode(), errmsg(), ERROR, executeItemUnwrapTargetArray(), executeNextItem(), fb(), getScalar(), jbvArray, jbvNumeric, jperOk, JsonbType(), jspGetNext(), jspOperationName(), next, NumericGetDatum(), palloc_object, and RETURN_ERROR.
Referenced by executeItemOptUnwrapTarget().
|
static |
Definition at line 2026 of file jsonpath_exec.c.
References error(), executeItemOptUnwrapResultNoThrow(), fb(), jpbFalse, jpbTrue, jpbUnknown, jperIsError, JsonValueListInitIterator(), JsonValueListNext(), and jspStrictAbsenceOfErrors.
Referenced by executeBoolItem().
|
static |
Definition at line 2244 of file jsonpath_exec.c.
References fb(), getScalar(), jbvString, jpbFalse, jpbTrue, and jpbUnknown.
Referenced by executeBoolItem().
|
static |
Definition at line 2177 of file jsonpath_exec.c.
References DatumGetNumeric(), DirectFunctionCall1, ereport, errcode(), errmsg(), ERROR, executeItemOptUnwrapResult(), executeNextItem(), fb(), getScalar(), jbvNumeric, jperIsError, jperNotFound, jperOk, JsonValueListInitIterator(), JsonValueListNext(), jspGetArg(), jspGetNext(), jspOperationName(), NumericGetDatum(), RETURN_ERROR, and val.
Referenced by executeItemOptUnwrapTarget().
|
static |
Definition at line 3460 of file jsonpath_exec.c.
References DatumGetNumeric(), DirectFunctionCall2, ereport, errcode(), errmsg(), ERROR, ErrorSaveContext::error_occurred, executeItem(), fb(), getScalar(), Int32GetDatum(), jbvNumeric, jperIsError, jperOk, JsonValueListHead(), JsonValueListLength(), numeric_int4_safe(), numeric_trunc(), NumericGetDatum(), and RETURN_ERROR.
Referenced by executeItemOptUnwrapTarget().
|
static |
Definition at line 2959 of file jsonpath_exec.c.
References elog, ERROR, getJsonPathVariable(), jbvBool, jbvNull, jbvNumeric, jbvString, jpiBool, jpiNull, jpiNumeric, jpiString, jpiVariable, jspGetBool(), jspGetNumeric(), jspGetString(), JsonPathItem::type, and value.
Referenced by executeItemOptUnwrapTarget().
|
static |
Definition at line 2992 of file jsonpath_exec.c.
References fb(), JsonPathVariable::isnull, jbvNull, JsonItemFromDatum(), lfirst, JsonPathVariable::name, JsonPathVariable::namelen, palloc_object, JsonbValue::type, JsonPathVariable::typid, JsonPathVariable::typmod, and JsonPathVariable::value.
Referenced by JsonPathExists(), JsonPathQuery(), JsonPathValue(), and JsonTableResetRowPattern().
|
static |
Definition at line 3142 of file jsonpath_exec.c.
References Assert, ereport, errcode(), errmsg(), ERROR, fb(), JsonPathExecContext::getVar, jpiVariable, jspGetString(), pnstrdup(), setBaseObject(), variable::type, value, and JsonPathExecContext::vars.
Referenced by getJsonPathItem().
|
static |
Definition at line 3174 of file jsonpath_exec.c.
References fb(), findJsonbValueFromContainer(), JB_FOBJECT, jbvString, JsonbInitBinary(), JsonbValue::type, and JsonbValue::val.
Referenced by jsonb_path_exists_internal(), jsonb_path_match_internal(), jsonb_path_query_array_internal(), jsonb_path_query_first_internal(), and jsonb_path_query_internal().
|
inlinestatic |
Definition at line 4093 of file jsonpath_exec.c.
References elog, ERROR, IsA, JSON_TABLE_EXEC_CONTEXT_MAGIC, and JsonTableExecContext::magic.
Referenced by JsonTableDestroyOpaque(), JsonTableFetchRow(), JsonTableGetValue(), and JsonTableSetDocument().
|
static |
Definition at line 3639 of file jsonpath_exec.c.
References Assert, fb(), jbvBinary, JsonContainerIsScalar, type, JsonbValue::type, and JsonbValue::val.
Referenced by executeBinaryArithmExpr(), executeDateTimeMethod(), executeLikeRegex(), executeNumericItemMethod(), executeStartsWith(), executeUnaryArithmExpr(), and getArrayIndex().
| Datum jsonb_path_exists | ( | PG_FUNCTION_ARGS | ) |
Definition at line 426 of file jsonpath_exec.c.
References jsonb_path_exists_internal().
|
static |
Definition at line 398 of file jsonpath_exec.c.
References countVariablesFromJsonb(), executeJsonPath(), fb(), getJsonPathVariableFromJsonb(), jperIsError, jperOk, PG_FREE_IF_COPY, PG_GETARG_BOOL, PG_GETARG_JSONB_P, PG_GETARG_JSONPATH_P, PG_NARGS, PG_RETURN_BOOL, and PG_RETURN_NULL.
Referenced by jsonb_path_exists(), jsonb_path_exists_opr(), and jsonb_path_exists_tz().
| Datum jsonb_path_exists_opr | ( | PG_FUNCTION_ARGS | ) |
Definition at line 443 of file jsonpath_exec.c.
References jsonb_path_exists_internal().
| Datum jsonb_path_exists_tz | ( | PG_FUNCTION_ARGS | ) |
Definition at line 432 of file jsonpath_exec.c.
References jsonb_path_exists_internal().
| Datum jsonb_path_match | ( | PG_FUNCTION_ARGS | ) |
Definition at line 496 of file jsonpath_exec.c.
References jsonb_path_match_internal().
|
static |
Definition at line 455 of file jsonpath_exec.c.
References countVariablesFromJsonb(), ereport, errcode(), errmsg(), ERROR, executeJsonPath(), fb(), getJsonPathVariableFromJsonb(), jbvBool, jbvNull, JsonValueListHead(), JsonValueListLength(), PG_FREE_IF_COPY, PG_GETARG_BOOL, PG_GETARG_JSONB_P, PG_GETARG_JSONPATH_P, PG_NARGS, PG_RETURN_BOOL, and PG_RETURN_NULL.
Referenced by jsonb_path_match(), jsonb_path_match_opr(), and jsonb_path_match_tz().
| Datum jsonb_path_match_opr | ( | PG_FUNCTION_ARGS | ) |
Definition at line 513 of file jsonpath_exec.c.
References jsonb_path_match_internal().
| Datum jsonb_path_match_tz | ( | PG_FUNCTION_ARGS | ) |
Definition at line 502 of file jsonpath_exec.c.
References jsonb_path_match_internal().
| Datum jsonb_path_query | ( | PG_FUNCTION_ARGS | ) |
Definition at line 573 of file jsonpath_exec.c.
References jsonb_path_query_internal().
| Datum jsonb_path_query_array | ( | PG_FUNCTION_ARGS | ) |
Definition at line 606 of file jsonpath_exec.c.
References jsonb_path_query_array_internal().
|
static |
Definition at line 590 of file jsonpath_exec.c.
References countVariablesFromJsonb(), executeJsonPath(), fb(), getJsonPathVariableFromJsonb(), JsonbValueToJsonb(), PG_GETARG_BOOL, PG_GETARG_JSONB_P, PG_GETARG_JSONPATH_P, PG_RETURN_JSONB_P, and wrapItemsInArray().
Referenced by jsonb_path_query_array(), and jsonb_path_query_array_tz().
| Datum jsonb_path_query_array_tz | ( | PG_FUNCTION_ARGS | ) |
Definition at line 612 of file jsonpath_exec.c.
References jsonb_path_query_array_internal().
| Datum jsonb_path_query_first | ( | PG_FUNCTION_ARGS | ) |
Definition at line 642 of file jsonpath_exec.c.
References jsonb_path_query_first_internal().
|
static |
Definition at line 623 of file jsonpath_exec.c.
References countVariablesFromJsonb(), executeJsonPath(), fb(), getJsonPathVariableFromJsonb(), JsonbValueToJsonb(), JsonValueListHead(), JsonValueListLength(), PG_GETARG_BOOL, PG_GETARG_JSONB_P, PG_GETARG_JSONPATH_P, PG_RETURN_JSONB_P, and PG_RETURN_NULL.
Referenced by jsonb_path_query_first(), and jsonb_path_query_first_tz().
| Datum jsonb_path_query_first_tz | ( | PG_FUNCTION_ARGS | ) |
Definition at line 648 of file jsonpath_exec.c.
References jsonb_path_query_first_internal().
|
static |
Definition at line 525 of file jsonpath_exec.c.
References countVariablesFromJsonb(), executeJsonPath(), fb(), getJsonPathVariableFromJsonb(), JsonbPGetDatum(), JsonbValueToJsonb(), JsonValueListGetList(), lfirst, list_delete_first(), list_head(), MemoryContextSwitchTo(), PG_GETARG_BOOL, PG_GETARG_JSONB_P_COPY, PG_GETARG_JSONPATH_P_COPY, SRF_FIRSTCALL_INIT, SRF_IS_FIRSTCALL, SRF_PERCALL_SETUP, SRF_RETURN_DONE, and SRF_RETURN_NEXT.
Referenced by jsonb_path_query(), and jsonb_path_query_tz().
| Datum jsonb_path_query_tz | ( | PG_FUNCTION_ARGS | ) |
Definition at line 579 of file jsonpath_exec.c.
References jsonb_path_query_internal().
|
static |
Definition at line 3226 of file jsonpath_exec.c.
References Assert, fb(), jbvArray, jbvBinary, JsonContainerIsArray, JsonContainerIsScalar, and JsonContainerSize.
Referenced by executeItemOptUnwrapTarget().
|
static |
Definition at line 3602 of file jsonpath_exec.c.
References fb(), jbvBinary, JsonbValue::type, and VARSIZE_ANY_EXHDR().
Referenced by executeJsonPath(), executeKeyValueMethod(), getJsonPathVariableFromJsonb(), and JsonItemFromDatum().
|
static |
Definition at line 3615 of file jsonpath_exec.c.
References Assert, elog, ERROR, fb(), JsonbContainer::header, jbvArray, jbvBinary, jbvObject, JsonContainerIsArray, JsonContainerIsObject, JsonContainerIsScalar, and type.
Referenced by executeItemOptUnwrapResult(), executeItemOptUnwrapTarget(), executeKeyValueMethod(), and executeNumericItemMethod().
|
static |
Definition at line 3132 of file jsonpath_exec.c.
References DatumGetNumeric(), fb(), and jbvNumeric.
Referenced by JsonItemFromDatum().
Definition at line 3050 of file jsonpath_exec.c.
References Assert, CStringGetDatum(), DatumGetBool(), DatumGetJsonbP(), DatumGetPointer(), DatumGetTextP, DirectFunctionCall1, ereport, errcode(), errmsg(), ERROR, fb(), float4_numeric(), float8_numeric(), format_type_be(), int2_numeric(), int4_numeric(), int8_numeric(), jbvBool, jbvDatetime, jbvString, jsonb_in(), JsonbExtractScalar(), JsonbInitBinary(), JsonbPGetDatum(), JsonbValueInitNumericDatum(), JsonContainerIsScalar, JsonItemFromDatum(), pfree(), PG_USED_FOR_ASSERTS_ONLY, str, text_to_cstring(), JsonbValue::type, JsonbValue::val, val, VARDATA_ANY(), and VARSIZE_ANY_EXHDR().
Referenced by GetJsonPathVar(), and JsonItemFromDatum().
Definition at line 3891 of file jsonpath_exec.c.
References Assert, CountJsonPathVars(), DatumGetJsonbP(), error(), executeJsonPath(), fb(), GetJsonPathVar(), jperIsError, and jperOk.
Referenced by ExecEvalJsonExprPath().
| Datum JsonPathQuery | ( | Datum | jb, |
| JsonPath * | jp, | ||
| JsonWrapper | wrapper, | ||
| bool * | empty, | ||
| bool * | error, | ||
| List * | vars, | ||
| const char * | column_name | ||
| ) |
Definition at line 3914 of file jsonpath_exec.c.
References Assert, CountJsonPathVars(), DatumGetJsonbP(), elog, ereport, errcode(), errhint(), errmsg(), ERROR, error(), executeJsonPath(), fb(), GetJsonPathVar(), jperIsError, JsonbPGetDatum(), JsonbValueToJsonb(), JsonValueListHead(), JsonValueListLength(), JSW_CONDITIONAL, JSW_NONE, JSW_UNCONDITIONAL, JSW_UNSPEC, PointerGetDatum(), and wrapItemsInArray().
Referenced by ExecEvalJsonExprPath().
| JsonbValue * JsonPathValue | ( | Datum | jb, |
| JsonPath * | jp, | ||
| bool * | empty, | ||
| bool * | error, | ||
| List * | vars, | ||
| const char * | column_name | ||
| ) |
Definition at line 4008 of file jsonpath_exec.c.
References Assert, CountJsonPathVars(), DatumGetJsonbP(), ereport, errcode(), errmsg(), ERROR, error(), executeJsonPath(), fb(), GetJsonPathVar(), IsAJsonbScalar, jbvBinary, jbvNull, jperIsError, JsonbExtractScalar(), JsonContainerIsScalar, JsonValueListHead(), JsonValueListLength(), PG_USED_FOR_ASSERTS_ONLY, JsonbValue::type, and JsonbValue::val.
Referenced by ExecEvalJsonExprPath().
|
static |
Definition at line 4178 of file jsonpath_exec.c.
References fb(), GetJsonTableExecContext(), and JsonTableExecContext::magic.
|
static |
Definition at line 4440 of file jsonpath_exec.c.
References GetJsonTableExecContext(), JsonTablePlanNextRow(), and JsonTableExecContext::rootplanstate.
|
static |
Definition at line 4456 of file jsonpath_exec.c.
References ExprContext::caseValue_datum, ExprContext::caseValue_isNull, JsonTableExecContext::colplanstates, JsonTablePlanState::current, ExecEvalExpr(), fb(), GetJsonTableExecContext(), Int32GetDatum(), JsonTablePlanRowSource::isnull, list_nth(), JsonTablePlanState::ordinal, and JsonTablePlanRowSource::value.
|
static |
Definition at line 4114 of file jsonpath_exec.c.
References Assert, castNode, JsonTableExecContext::colplanstates, CurrentMemoryContext, TableFunc::docexpr, ExecEvalExpr(), exprType(), exprTypmod(), fb(), forboth, JsonPathVariable::isnull, JSON_TABLE_EXEC_CONTEXT_MAGIC, JsonTableInitPlan(), lappend(), lfirst_node, list_length(), JsonTableExecContext::magic, name, JsonPathVariable::name, JsonPathVariable::namelen, NIL, palloc0_object, palloc_array, palloc_object, ps, pstrdup(), JsonTableExecContext::rootplanstate, JsonPathVariable::typid, JsonPathVariable::typmod, and JsonPathVariable::value.
|
static |
Definition at line 4195 of file jsonpath_exec.c.
References ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate, JsonTablePlanState::args, JsonTablePathScan::child, JsonTablePathScan::colMax, JsonTablePathScan::colMin, JsonTableExecContext::colplanstates, JsonTablePlanState::current, DatumGetJsonPathP(), fb(), i, IsA, JsonTablePlanRowSource::isnull, JsonTableInitPlan(), JsonTablePlanState::left, JsonTableSiblingJoin::lplan, JsonTablePlanState::mcxt, JsonTablePlanState::nested, palloc0_object, JsonTablePlanState::parent, JsonTablePlanState::path, JsonTablePathScan::path, JsonTablePlanState::plan, plan, PointerGetDatum(), JsonTablePlanState::right, JsonTableSiblingJoin::rplan, JsonTablePlanRowSource::value, and JsonTablePath::value.
Referenced by JsonTableInitOpaque(), and JsonTableInitPlan().
|
static |
Definition at line 4413 of file jsonpath_exec.c.
References JsonTablePlanNextRow(), JsonTablePlanState::left, and JsonTablePlanState::right.
Referenced by JsonTablePlanNextRow().
|
static |
Definition at line 4295 of file jsonpath_exec.c.
References Assert, elog, ERROR, IsA, JsonTablePlanJoinNextRow(), JsonTablePlanScanNextRow(), and JsonTablePlanState::plan.
Referenced by JsonTableFetchRow(), JsonTablePlanJoinNextRow(), and JsonTablePlanScanNextRow().
|
static |
Definition at line 4322 of file jsonpath_exec.c.
References JsonTablePlanState::current, fb(), JsonTablePlanState::found, JsonTablePlanRowSource::isnull, JsonTablePlanState::iter, JsonbPGetDatum(), JsonbValueToJsonb(), JsonTablePlanNextRow(), JsonTableResetNestedPlan(), JsonValueListNext(), JsonTablePlanState::mcxt, MemoryContextSwitchTo(), JsonTablePlanState::nested, JsonTablePlanState::ordinal, PointerGetDatum(), and JsonTablePlanRowSource::value.
Referenced by JsonTablePlanNextRow().
|
static |
Definition at line 4384 of file jsonpath_exec.c.
References Assert, JsonTablePlanState::current, fb(), IsA, JsonTablePlanRowSource::isnull, JsonTableResetNestedPlan(), JsonTableResetRowPattern(), JsonTablePlanState::left, JsonTablePlanState::parent, JsonTablePlanState::plan, JsonTablePlanState::right, and JsonTablePlanRowSource::value.
Referenced by JsonTablePlanScanNextRow(), and JsonTableResetNestedPlan().
|
static |
Definition at line 4255 of file jsonpath_exec.c.
References JsonTablePlanState::args, Assert, castNode, CountJsonPathVars(), JsonTablePlanState::current, DatumGetJsonbP(), JsonTablePathScan::errorOnError, executeJsonPath(), fb(), JsonTablePlanState::found, GetJsonPathVar(), JsonTablePlanRowSource::isnull, JsonTablePlanState::iter, jperIsError, JsonValueListClear(), JsonValueListInitIterator(), JsonTablePlanState::mcxt, MemoryContextResetOnly(), MemoryContextSwitchTo(), JsonTablePlanState::ordinal, JsonTablePlanState::path, JsonTablePlanState::plan, PointerGetDatum(), and JsonTablePlanRowSource::value.
Referenced by JsonTableResetNestedPlan(), and JsonTableSetDocument().
|
static |
Definition at line 4242 of file jsonpath_exec.c.
References GetJsonTableExecContext(), JsonTableResetRowPattern(), JsonTableExecContext::rootplanstate, and value.
|
static |
Definition at line 3514 of file jsonpath_exec.c.
References fb(), lappend(), and list_make2.
Referenced by executeAnyItem(), executeItemOptUnwrapResult(), and executeNextItem().
|
static |
Definition at line 3507 of file jsonpath_exec.c.
Referenced by JsonTableResetRowPattern().
|
static |
Definition at line 3546 of file jsonpath_exec.c.
References fb(), and list_make1.
Referenced by jsonb_path_query_internal().
|
static |
Definition at line 3540 of file jsonpath_exec.c.
References fb(), and linitial.
Referenced by executeBinaryArithmExpr(), getArrayIndex(), jsonb_path_match_internal(), jsonb_path_query_first_internal(), JsonPathQuery(), and JsonPathValue().
|
static |
Definition at line 3555 of file jsonpath_exec.c.
References fb(), linitial, list_second_cell(), and NIL.
Referenced by executeItemOptUnwrapResult(), executePredicate(), executeUnaryArithmExpr(), JsonTableResetRowPattern(), and wrapItemsInArray().
|
static |
Definition at line 3534 of file jsonpath_exec.c.
Referenced by executeBoolItem(), and executeJsonPath().
|
static |
Definition at line 3528 of file jsonpath_exec.c.
References fb(), and list_length().
Referenced by executeBinaryArithmExpr(), getArrayIndex(), jsonb_path_match_internal(), jsonb_path_query_first_internal(), JsonPathQuery(), and JsonPathValue().
|
static |
Definition at line 3581 of file jsonpath_exec.c.
References fb(), lfirst, lnext(), and JsonbValue::value.
Referenced by executeItemOptUnwrapResult(), executePredicate(), executeUnaryArithmExpr(), JsonTablePlanScanNextRow(), and wrapItemsInArray().
|
static |
Definition at line 3495 of file jsonpath_exec.c.
References JsonPathExecContext::baseObject, fb(), JsonBaseObjectInfo::id, JsonBaseObjectInfo::jbc, and jbvBinary.
Referenced by executeItemOptUnwrapTarget(), executeKeyValueMethod(), and getJsonPathVariable().
|
static |
Definition at line 3650 of file jsonpath_exec.c.
References fb(), items, JsonValueListInitIterator(), JsonValueListNext(), ps, pushJsonbValue(), WJB_BEGIN_ARRAY, WJB_ELEM, and WJB_END_ARRAY.
Referenced by jsonb_path_query_array_internal(), and JsonPathQuery().
| const TableFuncRoutine JsonbTableRoutine |
Definition at line 371 of file jsonpath_exec.c.
Referenced by ExecInitTableFuncScan().