PostgreSQL Source Code
git master
|
#include "postgres.h"
#include "catalog/pg_type.h"
#include "nodes/makefuncs.h"
#include "nodes/nodeFuncs.h"
#include "optimizer/optimizer.h"
#include "parser/parse_clause.h"
#include "parser/parse_collate.h"
#include "parser/parse_expr.h"
#include "parser/parse_relation.h"
#include "parser/parse_type.h"
#include "utils/fmgrprotos.h"
#include "utils/json.h"
#include "utils/lsyscache.h"
Go to the source code of this file.
Data Structures | |
struct | JsonTableParseContext |
Typedefs | |
typedef struct JsonTableParseContext | JsonTableParseContext |
Functions | |
static JsonTablePlan * | transformJsonTableColumns (JsonTableParseContext *cxt, List *columns, List *passingArgs, JsonTablePathSpec *pathspec) |
static JsonTablePlan * | transformJsonTableNestedColumns (JsonTableParseContext *cxt, List *passingArgs, List *columns) |
static JsonFuncExpr * | transformJsonTableColumn (JsonTableColumn *jtc, Node *contextItemExpr, List *passingArgs) |
static bool | isCompositeType (Oid typid) |
static JsonTablePlan * | makeJsonTablePathScan (JsonTablePathSpec *pathspec, bool errorOnError, int colMin, int colMax, JsonTablePlan *childplan) |
static void | CheckDuplicateColumnOrPathNames (JsonTableParseContext *cxt, List *columns) |
static bool | LookupPathOrColumnName (JsonTableParseContext *cxt, char *name) |
static char * | generateJsonTablePathName (JsonTableParseContext *cxt) |
static JsonTablePlan * | makeJsonTableSiblingJoin (JsonTablePlan *lplan, JsonTablePlan *rplan) |
ParseNamespaceItem * | transformJsonTable (ParseState *pstate, JsonTable *jt) |
typedef struct JsonTableParseContext JsonTableParseContext |
|
static |
Definition at line 171 of file parse_jsontable.c.
References castNode, JsonTableColumn::coltype, JsonTableColumn::columns, ereport, errcode(), errmsg(), ERROR, JTC_NESTED, lappend(), lfirst, JsonTableColumn::location, LookupPathOrColumnName(), JsonTablePathSpec::name, JsonTableColumn::name, JsonTablePathSpec::name_location, parser_errposition(), JsonTableParseContext::pathNames, JsonTableColumn::pathspec, and JsonTableParseContext::pstate.
Referenced by transformJsonTable().
|
static |
Definition at line 229 of file parse_jsontable.c.
References lappend(), name, JsonTableParseContext::pathNameId, JsonTableParseContext::pathNames, pstrdup(), and snprintf.
Referenced by transformJsonTable(), and transformJsonTableNestedColumns().
Definition at line 375 of file parse_jsontable.c.
References get_typtype(), getBaseType(), and type_is_array.
Referenced by AlterTypeNamespaceInternal(), and transformJsonTableColumns().
|
static |
Definition at line 214 of file parse_jsontable.c.
References lfirst, name, and JsonTableParseContext::pathNames.
Referenced by CheckDuplicateColumnOrPathNames().
|
static |
Definition at line 497 of file parse_jsontable.c.
References Assert, castNode, JsonTablePathScan::child, JsonTablePathScan::colMax, JsonTablePathScan::colMin, CStringGetDatum(), DirectFunctionCall1, JsonTablePathScan::errorOnError, InvalidOid, IsA, jsonpath_in(), makeConst(), makeJsonTablePath(), makeNode, JsonTablePathSpec::name, JsonTablePathScan::path, JsonTablePathScan::plan, JsonTablePathSpec::string, and value.
Referenced by transformJsonTableColumns().
|
static |
Definition at line 532 of file parse_jsontable.c.
References JsonTableSiblingJoin::lplan, makeNode, JsonTableSiblingJoin::plan, and JsonTableSiblingJoin::rplan.
Referenced by transformJsonTableNestedColumns().
ParseNamespaceItem* transformJsonTable | ( | ParseState * | pstate, |
JsonTable * | jt | ||
) |
Definition at line 74 of file parse_jsontable.c.
References addRangeTableEntryForTableFunc(), JsonTable::alias, Assert, JsonBehavior::btype, castNode, CheckDuplicateColumnOrPathNames(), JsonTable::columns, contain_vars_of_level(), JsonFuncExpr::context_item, JsonTable::context_item, copyObject, TableFunc::docexpr, ereport, errcode(), errdetail(), errmsg(), ERROR, EXPR_KIND_FROM_FUNCTION, TableFunc::functype, generateJsonTablePathName(), IsA, JSON_BEHAVIOR_EMPTY, JSON_BEHAVIOR_EMPTY_ARRAY, JSON_BEHAVIOR_ERROR, JSON_TABLE_OP, JsonTableParseContext::jt, JsonTable::lateral, list_make1, JsonFuncExpr::location, JsonTable::location, TableFunc::location, JsonBehavior::location, makeNode, JsonTablePathSpec::name, JsonFuncExpr::on_empty, JsonFuncExpr::on_error, JsonTable::on_error, JsonFuncExpr::op, ParseState::p_lateral_active, parser_errposition(), JsonFuncExpr::passing, JsonTable::passing, JsonExpr::passing_values, JsonTableParseContext::pathNameId, JsonTableParseContext::pathNames, JsonFuncExpr::pathspec, JsonTable::pathspec, JsonTablePathSpec::string, JsonTableParseContext::tf, TFT_JSON_TABLE, transformExpr(), and transformJsonTableColumns().
Referenced by transformFromClauseItem().
|
static |
Definition at line 397 of file parse_jsontable.c.
References appendStringInfoString(), Assert, JsonTableColumn::coltype, JsonFuncExpr::column_name, JsonFuncExpr::context_item, escape_json(), initStringInfo(), JS_ENC_DEFAULT, JS_FORMAT_DEFAULT, JSON_EXISTS_OP, JSON_QUERY_OP, JSON_VALUE_OP, JTC_EXISTS, JTC_REGULAR, makeJsonFormat(), makeJsonValueExpr(), makeNode, makeStringConst(), JsonTableColumn::name, JsonFuncExpr::op, JsonTableColumn::pathspec, pstrdup(), and JsonTablePathSpec::string.
Referenced by transformJsonTableColumns().
|
static |
Definition at line 249 of file parse_jsontable.c.
References Assert, assign_expr_collations(), JsonBehavior::btype, castNode, JsonTableColumn::coltype, TableFunc::docexpr, elog, ereport, errcode(), errmsg(), ERROR, EXPR_KIND_FROM_FUNCTION, exprCollation(), exprType(), exprTypmod(), InvalidOid, isCompositeType(), JS_QUOTES_UNSPEC, JSON_BEHAVIOR_ERROR, JSW_UNSPEC, JsonTableParseContext::jt, JTC_EXISTS, JTC_FOR_ORDINALITY, JTC_FORMATTED, JTC_NESTED, JTC_REGULAR, lappend(), lappend_int(), lappend_oid(), lfirst, list_length(), JsonTableColumn::location, makeJsonTablePathScan(), makeNode, makeString(), JsonTableColumn::name, JsonTable::on_error, parser_errposition(), JsonTableParseContext::pstate, pstrdup(), JsonTableColumn::quotes, JsonTableParseContext::tf, transformExpr(), transformJsonTableColumn(), transformJsonTableNestedColumns(), CaseTestExpr::typeId, JsonTableColumn::typeName, typenameTypeIdAndMod(), and JsonTableColumn::wrapper.
Referenced by transformJsonTable(), and transformJsonTableNestedColumns().
|
static |
Definition at line 452 of file parse_jsontable.c.
References castNode, JsonTableColumn::coltype, JsonTableColumn::columns, generateJsonTablePathName(), JTC_NESTED, lfirst, makeJsonTableSiblingJoin(), JsonTablePathSpec::name, JsonTableColumn::pathspec, plan, and transformJsonTableColumns().
Referenced by transformJsonTableColumns().