PostgreSQL Source Code
git master
|
#include "postgres.h"
#include "catalog/pg_collation.h"
#include "catalog/pg_type.h"
#include "executor/execExpr.h"
#include "funcapi.h"
#include "lib/stringinfo.h"
#include "miscadmin.h"
#include "nodes/nodeFuncs.h"
#include "regex/regex.h"
#include "utils/builtins.h"
#include "utils/date.h"
#include "utils/datetime.h"
#include "utils/datum.h"
#include "utils/float.h"
#include "utils/formatting.h"
#include "utils/guc.h"
#include "utils/json.h"
#include "utils/jsonpath.h"
#include "utils/lsyscache.h"
#include "utils/memutils.h"
#include "utils/timestamp.h"
#include "utils/varlena.h"
Go to the source code of this file.
Data Structures | |
struct | JsonBaseObjectInfo |
struct | JsonPathExecContext |
struct | JsonLikeRegexContext |
struct | JsonValueList |
struct | JsonValueListIterator |
struct | JsonTableScanState |
struct | JsonTableJoinState |
struct | JsonTableContext |
Macros | |
#define | jperIsError(jper) ((jper) == jperError) |
#define | JSON_TABLE_CONTEXT_MAGIC 418352867 |
#define | jspStrictAbsenseOfErrors(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) |
Typedefs | |
typedef struct JsonBaseObjectInfo | JsonBaseObjectInfo |
typedef int(* | JsonPathVarCallback) (void *vars, char *varName, int varNameLen, JsonbValue *val, JsonbValue *baseObject) |
typedef struct JsonPathExecContext | JsonPathExecContext |
typedef struct JsonLikeRegexContext | JsonLikeRegexContext |
typedef enum JsonPathBool | JsonPathBool |
typedef enum JsonPathExecResult | JsonPathExecResult |
typedef struct JsonValueList | JsonValueList |
typedef struct JsonValueListIterator | JsonValueListIterator |
typedef struct JsonTableScanState | JsonTableScanState |
typedef struct JsonTableJoinState | JsonTableJoinState |
typedef struct JsonTableContext | JsonTableContext |
typedef JsonPathBool(* | JsonPathPredicateCallback) (JsonPathItem *jsp, JsonbValue *larg, JsonbValue *rarg, void *param) |
typedef Numeric(* | BinaryArithmFunc) (Numeric num1, Numeric num2, bool *error) |
Enumerations | |
enum | JsonPathBool { jpbFalse = 0 , jpbTrue = 1 , jpbUnknown = 2 } |
enum | JsonPathExecResult { jperOk = 0 , jperNotFound = 1 , jperError = 2 } |
Variables | |
const TableFuncRoutine | JsonbTableRoutine |
#define jperIsError | ( | jper | ) | ((jper) == jperError) |
Definition at line 144 of file jsonpath_exec.c.
#define JSON_TABLE_CONTEXT_MAGIC 418352867 |
Definition at line 201 of file jsonpath_exec.c.
#define jspAutoUnwrap | ( | cxt | ) | ((cxt)->laxMode) |
Definition at line 217 of file jsonpath_exec.c.
#define jspAutoWrap | ( | cxt | ) | ((cxt)->laxMode) |
Definition at line 218 of file jsonpath_exec.c.
#define jspIgnoreStructuralErrors | ( | cxt | ) | ((cxt)->ignoreStructuralErrors) |
Definition at line 219 of file jsonpath_exec.c.
#define jspStrictAbsenseOfErrors | ( | cxt | ) | (!(cxt)->laxMode) |
Definition at line 216 of file jsonpath_exec.c.
#define jspThrowErrors | ( | cxt | ) | ((cxt)->throwErrors) |
Definition at line 220 of file jsonpath_exec.c.
#define RETURN_ERROR | ( | throw_error | ) |
Definition at line 223 of file jsonpath_exec.c.
Definition at line 235 of file jsonpath_exec.c.
typedef struct JsonBaseObjectInfo JsonBaseObjectInfo |
typedef struct JsonLikeRegexContext JsonLikeRegexContext |
typedef enum JsonPathBool JsonPathBool |
typedef struct JsonPathExecContext JsonPathExecContext |
typedef enum JsonPathExecResult JsonPathExecResult |
typedef JsonPathBool(* JsonPathPredicateCallback) (JsonPathItem *jsp, JsonbValue *larg, JsonbValue *rarg, void *param) |
Definition at line 231 of file jsonpath_exec.c.
typedef int(* JsonPathVarCallback) (void *vars, char *varName, int varNameLen, JsonbValue *val, JsonbValue *baseObject) |
Definition at line 93 of file jsonpath_exec.c.
typedef struct JsonTableContext JsonTableContext |
typedef struct JsonTableJoinState JsonTableJoinState |
Definition at line 93 of file jsonpath_exec.c.
typedef struct JsonTableScanState JsonTableScanState |
Definition at line 93 of file jsonpath_exec.c.
typedef struct JsonValueList JsonValueList |
typedef struct JsonValueListIterator JsonValueListIterator |
enum JsonPathBool |
enum JsonPathExecResult |
|
static |
Definition at line 2118 of file jsonpath_exec.c.
References executeNextItem(), jbvBool, jbvNull, jpbTrue, jpbUnknown, jperOk, jspGetNext(), next, res, JsonbValue::type, and JsonbValue::val.
Referenced by executeItemOptUnwrapTarget().
|
static |
Definition at line 2273 of file jsonpath_exec.c.
References cmp(), Min, s1, and s2.
Referenced by compareStrings().
Definition at line 2698 of file jsonpath_exec.c.
References checkTimezoneIsUsedForCast(), DirectFunctionCall1, and time_timetz().
Referenced by compareDatetime().
|
static |
Definition at line 2686 of file jsonpath_exec.c.
References ereport, errcode(), errhint(), errmsg(), and ERROR.
Referenced by castTimeToTimeTz(), cmpDateToTimestampTz(), and cmpTimestampToTimestampTz().
Definition at line 2710 of file jsonpath_exec.c.
References date_cmp_timestamp_internal().
Referenced by compareDatetime().
|
static |
Definition at line 2719 of file jsonpath_exec.c.
References checkTimezoneIsUsedForCast(), and date_cmp_timestamptz_internal().
Referenced by compareDatetime().
|
static |
Definition at line 2730 of file jsonpath_exec.c.
References checkTimezoneIsUsedForCast(), and timestamp_cmp_timestamptz_internal().
Referenced by compareDatetime().
|
static |
Definition at line 2743 of file jsonpath_exec.c.
References castTimeToTimeTz(), cmpDateToTimestamp(), cmpDateToTimestampTz(), cmpTimestampToTimestampTz(), date_cmp(), DatumGetDateADT, DatumGetInt32, DatumGetTimestamp, DatumGetTimestampTz, DirectFunctionCall2, elog, ERROR, time_cmp(), timestamp_cmp(), and timetz_cmp().
Referenced by compareItems().
|
static |
Definition at line 2361 of file jsonpath_exec.c.
References cmp(), compareDatetime(), compareNumeric(), compareStrings(), elog, ERROR, jbvArray, jbvBinary, jbvBool, jbvDatetime, jbvNull, jbvNumeric, jbvObject, jbvString, jpbFalse, jpbTrue, jpbUnknown, jpiEqual, jpiGreater, jpiGreaterOrEqual, jpiLess, jpiLessOrEqual, jpiNotEqual, res, JsonbValue::type, and JsonbValue::val.
Referenced by executeComparison().
Definition at line 2457 of file jsonpath_exec.c.
References a, b, DatumGetInt32, DirectFunctionCall2, numeric_cmp(), and NumericGetDatum.
Referenced by compareItems().
|
static |
Definition at line 2294 of file jsonpath_exec.c.
References binaryCompareStrings(), cmp(), GetDatabaseEncoding(), pfree(), pg_server_to_any(), PG_SQL_ASCII, and PG_UTF8.
Referenced by compareItems().
|
static |
Definition at line 2465 of file jsonpath_exec.c.
References palloc().
Referenced by executeAnyItem(), and executeNextItem().
|
static |
Definition at line 1448 of file jsonpath_exec.c.
References Assert(), check_stack_depth(), copyJsonbValue(), executeItemOptUnwrapTarget(), JsonPathExecContext::ignoreStructuralErrors, jbvBinary, jperIsError, jperNotFound, jperOk, JsonbIteratorInit(), JsonbIteratorNext(), JsonValueListAppend(), PG_UINT32_MAX, res, JsonbValue::type, JsonbValue::val, WJB_DONE, WJB_ELEM, WJB_KEY, and WJB_VALUE.
Referenced by executeItemOptUnwrapTarget(), and executeItemUnwrapTargetArray().
|
static |
Definition at line 1619 of file jsonpath_exec.c.
References ereport, errcode(), errmsg(), ERROR, error(), executeItemOptUnwrapResult(), executeNextItem(), getScalar(), jbvNumeric, jperError, jperIsError, jperOk, JsonValueListHead(), JsonValueListLength(), jspGetLeftArg(), jspGetNext(), jspGetRightArg(), jspOperationName(), jspThrowErrors, palloc(), res, RETURN_ERROR, JsonbValue::type, JsonPathItem::type, and JsonbValue::val.
Referenced by executeItemOptUnwrapTarget().
|
static |
Definition at line 1294 of file jsonpath_exec.c.
References JsonPathItem::base, JsonPathItem::content, elog, ERROR, executeComparison(), executeItemOptUnwrapResultNoThrow(), executeLikeRegex(), executePredicate(), executeStartsWith(), jpbFalse, jpbTrue, jpbUnknown, jperIsError, jperOk, jpiAnd, jpiEqual, jpiExists, jpiGreater, jpiGreaterOrEqual, jpiIsUnknown, jpiLess, jpiLessOrEqual, jpiLikeRegex, jpiNot, jpiNotEqual, jpiOr, jpiStartsWith, JsonValueListIsEmpty(), jspGetArg(), jspGetLeftArg(), jspGetRightArg(), jspHasNext, jspInitByBuffer(), jspStrictAbsenseOfErrors, JsonPathItem::like_regex, res, and JsonPathItem::type.
Referenced by executeItemOptUnwrapTarget(), and executeNestedBoolItem().
|
static |
Definition at line 2262 of file jsonpath_exec.c.
References cmp(), compareItems(), and JsonPathExecContext::useTz.
Referenced by executeBoolItem().
|
static |
Definition at line 1847 of file jsonpath_exec.c.
References JsonPathItem::arg, JsonPathItem::content, cstring_to_text(), cstring_to_text_with_len(), elog, ereport, errcode(), errhint(), errmsg(), ERROR, executeNextItem(), getScalar(), i, jbvDatetime, jbvString, jperError, jperIsError, jperNotFound, jperOk, jpiString, jspGetArg(), jspGetNext(), jspGetString(), jspOperationName(), jspThrowErrors, lengthof, MemoryContextSwitchTo(), palloc(), parse_datetime(), pfree(), res, RETURN_ERROR, text_to_cstring(), TopMemoryContext, JsonbValue::type, JsonPathItem::type, JsonbValue::val, and value.
Referenced by executeItemOptUnwrapTarget().
|
static |
Definition at line 671 of file jsonpath_exec.c.
References executeItemOptUnwrapTarget(), and jspAutoUnwrap.
Referenced by executeItemOptUnwrapResult(), executeJsonPath(), executeNextItem(), and getArrayIndex().
|
static |
Definition at line 1242 of file jsonpath_exec.c.
References Assert(), executeItem(), executeItemUnwrapTargetArray(), jbvArray, jperIsError, jperOk, JsonbType(), JsonValueListAppend(), JsonValueListInitIterator(), JsonValueListNext(), jspAutoUnwrap, res, and JsonbValue::type.
Referenced by executeBinaryArithmExpr(), executeItemOptUnwrapResultNoThrow(), and executeUnaryArithmExpr().
|
static |
Definition at line 1277 of file jsonpath_exec.c.
References executeItemOptUnwrapResult(), res, and JsonPathExecContext::throwErrors.
Referenced by executeBoolItem(), and executePredicate().
|
static |
Definition at line 683 of file jsonpath_exec.c.
References JsonPathItem::anybounds, appendBoolResult(), JsonPathItem::array, Assert(), JsonPathExecContext::baseObject, CHECK_FOR_INTERRUPTS, check_stack_depth(), JsonPathItem::content, JsonPathExecContext::current, DatumGetCString, DatumGetNumeric, DirectFunctionCall1, elog, ereport, errcode(), errmsg(), ERROR, executeAnyItem(), executeBinaryArithmExpr(), executeBoolItem(), executeDateTimeMethod(), executeItemUnwrapTargetArray(), executeKeyValueMethod(), executeNestedBoolItem(), executeNextItem(), executeNumericItemMethod(), executeUnaryArithmExpr(), findJsonbValueFromContainer(), float8_numeric(), Float8GetDatum(), float8in_internal_opt_error(), getArrayIndex(), getIthJsonbValueFromContainer(), getJsonPathItem(), i, JsonPathExecContext::ignoreStructuralErrors, JsonPathExecContext::innermostArraySize, int64_to_numeric(), JB_FOBJECT, jbvArray, jbvBinary, jbvNumeric, jbvObject, jbvString, jpbTrue, jperError, jperIsError, jperNotFound, jperOk, jpiAbs, jpiAdd, jpiAnd, jpiAny, jpiAnyArray, jpiAnyKey, jpiBool, jpiCeiling, jpiCurrent, jpiDatetime, jpiDiv, jpiDouble, jpiEqual, jpiExists, jpiFilter, jpiFloor, jpiGreater, jpiGreaterOrEqual, jpiIndexArray, jpiIsUnknown, jpiKey, jpiKeyValue, jpiLast, jpiLess, jpiLessOrEqual, jpiLikeRegex, jpiMinus, jpiMod, jpiMul, jpiNot, jpiNotEqual, jpiNull, jpiNumeric, jpiOr, jpiPlus, jpiRoot, jpiSize, jpiStartsWith, jpiString, jpiSub, jpiType, jpiVariable, JsonbArraySize(), JsonbType(), JsonbTypeName(), jspAutoUnwrap, jspAutoWrap, jspGetArg(), jspGetArraySubscript(), jspGetNext(), jspGetString(), jspHasNext, jspIgnoreStructuralErrors, jspOperationName(), jspThrowErrors, sort-test::key, numeric_abs(), numeric_add_opt_error(), numeric_ceil(), numeric_div_opt_error(), numeric_floor(), numeric_mod_opt_error(), numeric_mul_opt_error(), numeric_out(), numeric_sub_opt_error(), numeric_uminus(), NumericGetDatum, palloc(), pfree(), pnstrdup(), pstrdup(), range(), res, RETURN_ERROR, JsonPathExecContext::root, setBaseObject(), JsonbValue::type, JsonPathItem::type, JsonbValue::val, and val.
Referenced by executeAnyItem(), and executeItem().
|
static |
Definition at line 1191 of file jsonpath_exec.c.
References Assert(), elog, ERROR, executeAnyItem(), jbvArray, jbvBinary, JsonbValue::type, and JsonbValue::val.
Referenced by executeItemOptUnwrapResult(), executeItemOptUnwrapTarget(), and executeNumericItemMethod().
|
static |
Definition at line 616 of file jsonpath_exec.c.
References Assert(), JsonPathExecContext::baseObject, JsonPathExecContext::current, executeItem(), JsonPathExecContext::getVar, JsonPath::header, JsonBaseObjectInfo::id, JsonPathExecContext::ignoreStructuralErrors, JsonPathExecContext::innermostArraySize, JsonBaseObjectInfo::jbc, jperIsError, jperNotFound, jperOk, JsonbExtractScalar(), JsonbInitBinary(), JSONPATH_LAX, JsonValueListIsEmpty(), jspInit(), jspStrictAbsenseOfErrors, JsonPathExecContext::lastGeneratedObjectId, JsonPathExecContext::laxMode, res, 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 JsonTableResetContextItem().
|
static |
Definition at line 2008 of file jsonpath_exec.c.
References Assert(), JsonPathExecContext::baseObject, ereport, errcode(), errmsg(), ERROR, executeNextItem(), JsonBaseObjectInfo::id, int64_to_numeric(), JsonBaseObjectInfo::jbc, jbvBinary, jbvNumeric, jbvObject, jbvString, jperIsError, jperNotFound, jperOk, JsonbInitBinary(), JsonbIteratorInit(), JsonbIteratorNext(), JsonbType(), JsonbValueToJsonb(), JsonContainerSize, jspGetNext(), jspOperationName(), sort-test::key, JsonPathExecContext::lastGeneratedObjectId, next, pushJsonbValue(), res, RETURN_ERROR, setBaseObject(), JsonbValue::type, JsonPathItem::type, JsonbValue::val, val, WJB_BEGIN_OBJECT, WJB_DONE, WJB_END_OBJECT, WJB_KEY, and WJB_VALUE.
Referenced by executeItemOptUnwrapTarget().
|
static |
Definition at line 1781 of file jsonpath_exec.c.
References JsonLikeRegexContext::cflags, JsonPathItem::content, cstring_to_text_with_len(), getScalar(), jbvString, jpbFalse, jpbTrue, jpbUnknown, jspConvertRegexFlags(), JsonPathItem::like_regex, RE_compile_and_execute(), JsonLikeRegexContext::regex, and generate_unaccent_rules::str.
Referenced by executeBoolItem().
|
static |
Definition at line 1427 of file jsonpath_exec.c.
References JsonPathExecContext::current, executeBoolItem(), and res.
Referenced by executeItemOptUnwrapTarget().
|
static |
Definition at line 1211 of file jsonpath_exec.c.
References copyJsonbValue(), cur, executeItem(), jperOk, JsonValueListAppend(), jspGetNext(), jspHasNext, and next.
Referenced by appendBoolResult(), executeBinaryArithmExpr(), executeDateTimeMethod(), executeItemOptUnwrapTarget(), executeKeyValueMethod(), executeNumericItemMethod(), and executeUnaryArithmExpr().
|
static |
Definition at line 1811 of file jsonpath_exec.c.
References DatumGetNumeric, DirectFunctionCall1, ereport, errcode(), errmsg(), ERROR, executeItemUnwrapTargetArray(), executeNextItem(), getScalar(), jbvArray, jbvNumeric, jperOk, JsonbType(), jspGetNext(), jspOperationName(), next, NumericGetDatum, palloc(), RETURN_ERROR, JsonbValue::type, JsonPathItem::type, and JsonbValue::val.
Referenced by executeItemOptUnwrapTarget().
|
static |
Definition at line 1539 of file jsonpath_exec.c.
References error(), executeItemOptUnwrapResultNoThrow(), jpbFalse, jpbTrue, jpbUnknown, jperIsError, JsonValueListInitIterator(), JsonValueListNext(), jspStrictAbsenseOfErrors, and res.
Referenced by executeBoolItem().
|
static |
Definition at line 1757 of file jsonpath_exec.c.
References getScalar(), jbvString, jpbFalse, jpbTrue, jpbUnknown, and JsonbValue::val.
Referenced by executeBoolItem().
|
static |
Definition at line 1690 of file jsonpath_exec.c.
References DatumGetNumeric, DirectFunctionCall1, ereport, errcode(), errmsg(), ERROR, executeItemOptUnwrapResult(), executeNextItem(), getScalar(), jbvNumeric, jperIsError, jperNotFound, jperOk, JsonValueListInitIterator(), JsonValueListNext(), jspGetArg(), jspGetNext(), jspOperationName(), NumericGetDatum, RETURN_ERROR, JsonPathItem::type, and val.
Referenced by executeItemOptUnwrapTarget().
|
static |
Definition at line 2479 of file jsonpath_exec.c.
References DatumGetNumeric, DirectFunctionCall2, ereport, errcode(), errmsg(), ERROR, executeItem(), getScalar(), Int32GetDatum, jbvNumeric, jperIsError, jperOk, JsonValueListHead(), JsonValueListLength(), numeric_int4_opt_error(), numeric_trunc(), NumericGetDatum, res, RETURN_ERROR, and JsonbValue::val.
Referenced by executeItemOptUnwrapTarget().
|
static |
Definition at line 2146 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 2179 of file jsonpath_exec.c.
References Assert(), ereport, errcode(), errmsg(), ERROR, JsonPathExecContext::getVar, jpiVariable, jspGetString(), pnstrdup(), setBaseObject(), variable::type, value, and JsonPathExecContext::vars.
Referenced by getJsonPathItem().
|
static |
Definition at line 2203 of file jsonpath_exec.c.
References ereport, errcode(), errdetail(), errmsg(), ERROR, findJsonbValueFromContainer(), JB_FOBJECT, jbvString, JsonbInitBinary(), JsonContainerIsObject, pfree(), JsonbValue::type, JsonbValue::val, and value.
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 3149 of file jsonpath_exec.c.
References elog, ERROR, if(), IsA, JSON_TABLE_CONTEXT_MAGIC, and JsonTableContext::magic.
Referenced by JsonTableDestroyOpaque(), JsonTableFetchRow(), JsonTableGetValue(), and JsonTableSetDocument().
|
static |
Definition at line 2658 of file jsonpath_exec.c.
References Assert(), jbvBinary, JsonContainerIsScalar, generate_unaccent_rules::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 371 of file jsonpath_exec.c.
References jsonb_path_exists_internal().
|
static |
Definition at line 344 of file jsonpath_exec.c.
References executeJsonPath(), getJsonPathVariableFromJsonb(), jperIsError, jperOk, PG_FREE_IF_COPY, PG_GETARG_BOOL, PG_GETARG_JSONB_P, PG_GETARG_JSONPATH_P, PG_NARGS, PG_RETURN_BOOL, PG_RETURN_NULL, and res.
Referenced by jsonb_path_exists(), jsonb_path_exists_opr(), and jsonb_path_exists_tz().
Datum jsonb_path_exists_opr | ( | PG_FUNCTION_ARGS | ) |
Datum jsonb_path_exists_tz | ( | PG_FUNCTION_ARGS | ) |
Definition at line 377 of file jsonpath_exec.c.
References jsonb_path_exists_internal().
Datum jsonb_path_match | ( | PG_FUNCTION_ARGS | ) |
Definition at line 440 of file jsonpath_exec.c.
References jsonb_path_match_internal().
|
static |
Definition at line 400 of file jsonpath_exec.c.
References ereport, errcode(), errmsg(), ERROR, executeJsonPath(), 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, PG_RETURN_NULL, JsonbValue::type, and JsonbValue::val.
Referenced by jsonb_path_match(), jsonb_path_match_opr(), and jsonb_path_match_tz().
Datum jsonb_path_match_opr | ( | PG_FUNCTION_ARGS | ) |
Datum jsonb_path_match_tz | ( | PG_FUNCTION_ARGS | ) |
Definition at line 446 of file jsonpath_exec.c.
References jsonb_path_match_internal().
Datum jsonb_path_query | ( | PG_FUNCTION_ARGS | ) |
Definition at line 516 of file jsonpath_exec.c.
References jsonb_path_query_internal().
Datum jsonb_path_query_array | ( | PG_FUNCTION_ARGS | ) |
Definition at line 548 of file jsonpath_exec.c.
References jsonb_path_query_array_internal().
|
static |
Definition at line 533 of file jsonpath_exec.c.
References executeJsonPath(), 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 554 of file jsonpath_exec.c.
References jsonb_path_query_array_internal().
Datum jsonb_path_query_first | ( | PG_FUNCTION_ARGS | ) |
Definition at line 583 of file jsonpath_exec.c.
References jsonb_path_query_first_internal().
|
static |
Definition at line 565 of file jsonpath_exec.c.
References executeJsonPath(), 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 589 of file jsonpath_exec.c.
References jsonb_path_query_first_internal().
|
static |
Definition at line 469 of file jsonpath_exec.c.
References executeJsonPath(), getJsonPathVariableFromJsonb(), JsonbPGetDatum, JsonbValueToJsonb(), JsonValueListGetList(), lfirst, list_delete_first(), list_head(), MemoryContextSwitchTo(), FuncCallContext::multi_call_memory_ctx, 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, SRF_RETURN_NEXT, and FuncCallContext::user_fctx.
Referenced by jsonb_path_query(), and jsonb_path_query_tz().
Datum jsonb_path_query_tz | ( | PG_FUNCTION_ARGS | ) |
Definition at line 522 of file jsonpath_exec.c.
References jsonb_path_query_internal().
|
static |
Definition at line 2245 of file jsonpath_exec.c.
References Assert(), jbvArray, jbvBinary, JsonContainerIsArray, JsonContainerIsScalar, JsonContainerSize, JsonbValue::type, and JsonbValue::val.
Referenced by executeItemOptUnwrapTarget().
|
static |
Definition at line 2621 of file jsonpath_exec.c.
References jbvBinary, Jsonb::root, JsonbValue::type, JsonbValue::val, and VARSIZE_ANY_EXHDR.
Referenced by executeJsonPath(), executeKeyValueMethod(), getJsonPathVariableFromJsonb(), and JsonItemFromDatum().
|
static |
Definition at line 2634 of file jsonpath_exec.c.
References Assert(), elog, ERROR, JsonbContainer::header, jbvArray, jbvBinary, jbvObject, JsonContainerIsArray, JsonContainerIsObject, JsonContainerIsScalar, generate_unaccent_rules::type, JsonbValue::type, and JsonbValue::val.
Referenced by executeItemOptUnwrapResult(), executeItemOptUnwrapTarget(), executeKeyValueMethod(), and executeNumericItemMethod().
|
static |
Definition at line 3055 of file jsonpath_exec.c.
References DatumGetNumeric, jbvNumeric, JsonbValue::type, and JsonbValue::val.
Referenced by JsonItemFromDatum().
void JsonItemFromDatum | ( | Datum | val, |
Oid | typid, | ||
int32 | typmod, | ||
JsonbValue * | res | ||
) |
Definition at line 3062 of file jsonpath_exec.c.
References Assert(), CStringGetDatum, DatumGetBool, DatumGetJsonbP, DatumGetTextP, DirectFunctionCall1, ereport, errcode(), errmsg(), ERROR, float4_numeric(), float8_numeric(), int2_numeric(), int4_numeric(), int8_numeric(), jbvBool, jbvDatetime, jbvString, jsonb_in(), JsonbExtractScalar(), JsonbInitBinary(), JsonbPGetDatum, JsonbValueInitNumericDatum(), JsonContainerIsScalar, pfree(), PG_USED_FOR_ASSERTS_ONLY, res, Jsonb::root, generate_unaccent_rules::str, text_to_cstring(), val, VARDATA_ANY, and VARSIZE_ANY_EXHDR.
Referenced by EvalJsonPathVar().
Definition at line 2904 of file jsonpath_exec.c.
References Assert(), DatumGetJsonbP, error(), EvalJsonPathVar(), executeJsonPath(), jperIsError, jperOk, and res.
Referenced by ExecEvalJsonExpr().
Datum JsonPathQuery | ( | Datum | jb, |
JsonPath * | jp, | ||
JsonWrapper | wrapper, | ||
bool * | empty, | ||
bool * | error, | ||
List * | vars | ||
) |
Definition at line 2919 of file jsonpath_exec.c.
References Assert(), DatumGetJsonbP, elog, ereport, errcode(), errhint(), errmsg(), ERROR, error(), EvalJsonPathVar(), executeJsonPath(), IsAJsonbScalar, jbvBinary, jperIsError, JsonbPGetDatum, JsonbValueToJsonb(), JsonContainerIsScalar, JsonValueListHead(), JsonValueListLength(), JSW_CONDITIONAL, JSW_NONE, JSW_UNCONDITIONAL, PG_USED_FOR_ASSERTS_ONLY, PointerGetDatum, res, JsonbValue::type, JsonbValue::val, and wrapItemsInArray().
Referenced by ExecEvalJsonExpr().
Definition at line 2988 of file jsonpath_exec.c.
References Assert(), pg_result::binary, DatumGetJsonbP, ereport, errcode(), errmsg(), ERROR, error(), EvalJsonPathVar(), executeJsonPath(), IsAJsonbScalar, jbvBinary, jbvNull, jperIsError, JsonbExtractScalar(), JsonContainerIsScalar, JsonValueListHead(), JsonValueListLength(), PG_USED_FOR_ASSERTS_ONLY, and res.
Referenced by ExecEvalJsonExpr().
|
static |
Definition at line 3543 of file jsonpath_exec.c.
References GetJsonTableContext(), and JsonTableContext::magic.
|
static |
Definition at line 3494 of file jsonpath_exec.c.
References JsonTableContext::empty, GetJsonTableContext(), JsonTableNextRow(), and JsonTableContext::root.
|
static |
Definition at line 3512 of file jsonpath_exec.c.
References JsonTableContext::colexprs, JsonTableScanState::currentIsNull, ExecEvalExpr(), JsonTableContext::expr, GetJsonTableContext(), Int32GetDatum, JsonTableScanState::ordinal, and JsonTableContext::scan.
|
static |
Definition at line 3220 of file jsonpath_exec.c.
References generate_unaccent_rules::args, castNode, JsonTableContext::colexprs, TableFunc::colvalexprs, JsonTableScanState::current, JsonTableScanState::currentIsNull, CurrentMemoryContext, TableFunc::docexpr, JsonPathVariableEvalContext::econtext, JsonPathVariableEvalContext::estate, JsonPathVariableEvalContext::evaluated, ExecInitExpr(), ExecInitExprWithCaseValue(), JsonTableContext::expr, exprType(), exprTypmod(), forboth, i, JsonPathVariableEvalContext::isnull, JSON_TABLE_CONTEXT_MAGIC, JsonTableInitScanState(), lappend(), lfirst, lfirst_node, list_length(), JsonTableContext::magic, JsonPathVariableEvalContext::mcxt, name, JsonPathVariableEvalContext::name, NIL, palloc(), palloc0(), JsonExpr::passing_names, JsonExpr::passing_values, PlanState::plan, TableFunc::plan, PlanState::ps_ExprContext, pstrdup(), JsonTableContext::root, JsonTableContext::scan, TableFuncScan::tablefunc, JsonPathVariableEvalContext::typid, JsonPathVariableEvalContext::typmod, and JsonPathVariableEvalContext::value.
|
static |
Definition at line 3188 of file jsonpath_exec.c.
References JsonTableScanState::args, castNode, JsonTableSibling::cross, IsA, JsonTableInitScanState(), JsonTableSibling::larg, JsonTableScanState::mcxt, palloc0(), and JsonTableSibling::rarg.
Referenced by JsonTableInitScanState().
|
static |
Definition at line 3164 of file jsonpath_exec.c.
References ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate, generate_unaccent_rules::args, JsonTableScanState::args, JsonTableParent::child, JsonTableContext::colexprs, JsonTableParent::colMin, Const::constvalue, JsonTableScanState::current, JsonTableScanState::currentIsNull, DatumGetJsonPathP, JsonTableScanState::errorOnError, JsonTableParent::errorOnError, i, JsonTableInitPlanState(), JsonTableScanState::mcxt, JsonTableScanState::nested, JsonTableScanState::outerJoin, JsonTableParent::outerJoin, JsonTableScanState::parent, JsonTableScanState::path, JsonTableParent::path, PointerGetDatum, and JsonTableContext::scan.
Referenced by JsonTableInitOpaque(), and JsonTableInitPlanState().
|
static |
Definition at line 3410 of file jsonpath_exec.c.
Referenced by JsonTableNextRow().
|
static |
Definition at line 3359 of file jsonpath_exec.c.
References JsonTableNextRow(), and JsonTableRescanRecursive().
Referenced by JsonTableNextRow().
|
static |
Definition at line 3434 of file jsonpath_exec.c.
References JsonTableScanState::advanceNested, Assert(), JsonTableScanState::current, JsonTableScanState::currentIsNull, JsonTableScanState::found, JsonTableScanState::iter, JsonbPGetDatum, JsonbValueToJsonb(), JsonTableJoinReset(), JsonTableNextJoinRow(), JsonTableResetContextItem(), JsonValueListNext(), JsonTableScanState::mcxt, MemoryContextSwitchTo(), JsonTableScanState::nested, JsonTableScanState::ordinal, JsonTableScanState::outerJoin, JsonTableScanState::parent, PointerGetDatum, and JsonTableScanState::reset.
Referenced by JsonTableFetchRow(), and JsonTableNextJoinRow().
|
static |
Definition at line 3286 of file jsonpath_exec.c.
References JsonTableScanState::advanceNested, JsonTableScanState::current, JsonTableScanState::currentIsNull, JsonTableScanState::found, JsonTableScanState::iter, JsonValueListInitIterator(), JsonTableScanState::ordinal, and PointerGetDatum.
Referenced by JsonTableRescanRecursive(), and JsonTableResetContextItem().
|
static |
Definition at line 3337 of file jsonpath_exec.c.
References JsonTableRescan().
Referenced by JsonTableNextJoinRow().
|
static |
Definition at line 3297 of file jsonpath_exec.c.
References JsonTableScanState::args, Assert(), DatumGetJsonbP, JsonTableScanState::errorOnError, EvalJsonPathVar(), executeJsonPath(), JsonTableScanState::found, jperIsError, JsonTableRescan(), JsonValueListClear(), JsonTableScanState::mcxt, MemoryContextResetOnly(), MemoryContextSwitchTo(), JsonTableScanState::path, and res.
Referenced by JsonTableNextRow(), and JsonTableSetDocument().
|
static |
Definition at line 3328 of file jsonpath_exec.c.
References GetJsonTableContext(), JsonTableResetContextItem(), JsonTableContext::root, and value.
|
static |
Definition at line 2533 of file jsonpath_exec.c.
References lappend(), JsonValueList::list, list_make2, and JsonValueList::singleton.
Referenced by executeAnyItem(), executeItemOptUnwrapResult(), and executeNextItem().
|
static |
Definition at line 2526 of file jsonpath_exec.c.
References JsonValueList::list, and JsonValueList::singleton.
Referenced by JsonTableResetContextItem().
|
static |
Definition at line 2565 of file jsonpath_exec.c.
References JsonValueList::list, list_make1, and JsonValueList::singleton.
Referenced by jsonb_path_query_internal().
|
static |
Definition at line 2559 of file jsonpath_exec.c.
References linitial, JsonValueList::list, and JsonValueList::singleton.
Referenced by executeBinaryArithmExpr(), getArrayIndex(), jsonb_path_match_internal(), jsonb_path_query_first_internal(), JsonPathQuery(), and JsonPathValue().
|
static |
Definition at line 2574 of file jsonpath_exec.c.
References linitial, JsonValueList::list, JsonValueListIterator::list, list_second_cell(), JsonValueListIterator::next, NIL, JsonValueList::singleton, and JsonValueListIterator::value.
Referenced by executeItemOptUnwrapResult(), executePredicate(), executeUnaryArithmExpr(), JsonTableRescan(), and wrapItemsInArray().
|
static |
Definition at line 2553 of file jsonpath_exec.c.
References JsonValueList::list, list_length(), and JsonValueList::singleton.
Referenced by executeBoolItem(), and executeJsonPath().
|
static |
Definition at line 2547 of file jsonpath_exec.c.
References JsonValueList::list, list_length(), and JsonValueList::singleton.
Referenced by executeBinaryArithmExpr(), getArrayIndex(), jsonb_path_match_internal(), jsonb_path_query_first_internal(), JsonPathQuery(), and JsonPathValue().
|
static |
Definition at line 2600 of file jsonpath_exec.c.
References lfirst, JsonValueListIterator::list, lnext(), JsonValueListIterator::next, and JsonValueListIterator::value.
Referenced by executeItemOptUnwrapResult(), executePredicate(), executeUnaryArithmExpr(), JsonTableNextRow(), and wrapItemsInArray().
|
static |
Definition at line 2514 of file jsonpath_exec.c.
References JsonPathExecContext::baseObject, JsonBaseObjectInfo::id, JsonBaseObjectInfo::jbc, jbvBinary, JsonbValue::type, and JsonbValue::val.
Referenced by executeItemOptUnwrapTarget(), executeKeyValueMethod(), and getJsonPathVariable().
|
static |
Definition at line 2669 of file jsonpath_exec.c.
References JsonValueListInitIterator(), JsonValueListNext(), 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 3553 of file jsonpath_exec.c.
Referenced by ExecInitTableFuncScan().