PostgreSQL Source Code
git master
|
#include "postgres.h"
#include "executor/execExpr.h"
#include "nodes/nodeFuncs.h"
#include "nodes/subscripting.h"
#include "parser/parse_coerce.h"
#include "parser/parse_expr.h"
#include "utils/builtins.h"
#include "utils/jsonb.h"
Go to the source code of this file.
Data Structures | |
struct | JsonbSubWorkspace |
Typedefs | |
typedef struct JsonbSubWorkspace | JsonbSubWorkspace |
Functions | |
static void | jsonb_subscript_transform (SubscriptingRef *sbsref, List *indirection, ParseState *pstate, bool isSlice, bool isAssignment) |
static bool | jsonb_subscript_check_subscripts (ExprState *state, ExprEvalStep *op, ExprContext *econtext) |
static void | jsonb_subscript_fetch (ExprState *state, ExprEvalStep *op, ExprContext *econtext) |
static void | jsonb_subscript_assign (ExprState *state, ExprEvalStep *op, ExprContext *econtext) |
static void | jsonb_subscript_fetch_old (ExprState *state, ExprEvalStep *op, ExprContext *econtext) |
static void | jsonb_exec_setup (const SubscriptingRef *sbsref, SubscriptingRefState *sbsrefstate, SubscriptExecSteps *methods) |
Datum | jsonb_subscript_handler (PG_FUNCTION_ARGS) |
typedef struct JsonbSubWorkspace JsonbSubWorkspace |
|
static |
Definition at line 353 of file jsonbsubs.c.
References JsonbSubWorkspace::expectArray, exprType(), foreach_current_index, i, JsonbSubWorkspace::index, JsonbSubWorkspace::indexOid, jsonb_subscript_assign(), jsonb_subscript_check_subscripts(), jsonb_subscript_fetch(), jsonb_subscript_fetch_old(), List::length, lfirst, MAXALIGN, palloc0(), SubscriptingRef::refupperindexpr, SubscriptExecSteps::sbs_assign, SubscriptExecSteps::sbs_check_subscripts, SubscriptExecSteps::sbs_fetch, SubscriptExecSteps::sbs_fetch_old, and SubscriptingRefState::workspace.
Referenced by jsonb_subscript_handler().
|
static |
Definition at line 261 of file jsonbsubs.c.
References ExprEvalStep::d, DatumGetJsonbP(), JsonbSubWorkspace::expectArray, if(), JsonbSubWorkspace::index, jbvArray, jbvNull, jbvObject, jsonb_set_element(), JsonbToJsonbValue(), JsonbValueToJsonb(), SubscriptingRefState::numupper, SubscriptingRefState::replacenull, SubscriptingRefState::replacevalue, ExprEvalStep::resnull, ExprEvalStep::resvalue, ExprEvalStep::sbsref, JsonbValue::type, JsonbValue::val, and SubscriptingRefState::workspace.
Referenced by jsonb_exec_setup().
|
static |
Definition at line 175 of file jsonbsubs.c.
References CStringGetTextDatum, ExprEvalStep::d, DatumGetCString(), DirectFunctionCall1, ereport, errcode(), errmsg(), ERROR, JsonbSubWorkspace::expectArray, i, if(), JsonbSubWorkspace::index, JsonbSubWorkspace::indexOid, int4out(), SubscriptingRefState::isassignment, SubscriptingRefState::numupper, ExprEvalStep::resnull, ExprEvalStep::sbsref_subscript, SubscriptingRefState::upperindex, SubscriptingRefState::upperindexnull, SubscriptingRefState::upperprovided, and SubscriptingRefState::workspace.
Referenced by jsonb_exec_setup().
|
static |
Definition at line 235 of file jsonbsubs.c.
References Assert, ExprEvalStep::d, DatumGetJsonbP(), JsonbSubWorkspace::index, jsonb_get_element(), SubscriptingRefState::numupper, ExprEvalStep::resnull, ExprEvalStep::resvalue, ExprEvalStep::sbsref, and SubscriptingRefState::workspace.
Referenced by jsonb_exec_setup().
|
static |
Definition at line 323 of file jsonbsubs.c.
References ExprEvalStep::d, DatumGetJsonbP(), jsonb_get_element(), SubscriptingRefState::numupper, SubscriptingRefState::prevnull, SubscriptingRefState::prevvalue, ExprEvalStep::resnull, ExprEvalStep::resvalue, ExprEvalStep::sbsref, and SubscriptingRefState::upperindex.
Referenced by jsonb_exec_setup().
Datum jsonb_subscript_handler | ( | PG_FUNCTION_ARGS | ) |
Definition at line 402 of file jsonbsubs.c.
References jsonb_exec_setup(), jsonb_subscript_transform(), PG_RETURN_POINTER, and SubscriptRoutines::transform.
|
static |
Definition at line 43 of file jsonbsubs.c.
References Assert, can_coerce_type(), COERCE_IMPLICIT_CAST, coerce_type(), COERCION_IMPLICIT, ereport, errcode(), errhint(), errmsg(), ERROR, exprLocation(), exprType(), format_type_be(), i, idx(), InvalidOid, A_Indices::is_slice, lappend(), lfirst_node, A_Indices::lidx, NIL, ParseState::p_expr_kind, parser_errposition(), SubscriptingRef::reflowerindexpr, SubscriptingRef::refupperindexpr, transformExpr(), and A_Indices::uidx.
Referenced by jsonb_subscript_handler().