PostgreSQL Source Code
git master
|
Go to the source code of this file.
Typedefs | |
typedef void(* | post_parse_analyze_hook_type) (ParseState *pstate, Query *query, JumbleState *jstate) |
Functions | |
Query * | parse_analyze_fixedparams (RawStmt *parseTree, const char *sourceText, const Oid *paramTypes, int numParams, QueryEnvironment *queryEnv) |
Query * | parse_analyze_varparams (RawStmt *parseTree, const char *sourceText, Oid **paramTypes, int *numParams, QueryEnvironment *queryEnv) |
Query * | parse_analyze_withcb (RawStmt *parseTree, const char *sourceText, ParserSetupHook parserSetup, void *parserSetupArg, QueryEnvironment *queryEnv) |
Query * | parse_sub_analyze (Node *parseTree, ParseState *parentParseState, CommonTableExpr *parentCTE, bool locked_from_parent, bool resolve_unknowns) |
List * | transformInsertRow (ParseState *pstate, List *exprlist, List *stmtcols, List *icolumns, List *attrnos, bool strip_indirection) |
List * | transformUpdateTargetList (ParseState *pstate, List *origTlist) |
List * | transformReturningList (ParseState *pstate, List *returningList, ParseExprKind exprKind) |
Query * | transformTopLevelStmt (ParseState *pstate, RawStmt *parseTree) |
Query * | transformStmt (ParseState *pstate, Node *parseTree) |
bool | stmt_requires_parse_analysis (RawStmt *parseTree) |
bool | analyze_requires_snapshot (RawStmt *parseTree) |
const char * | LCS_asString (LockClauseStrength strength) |
void | CheckSelectLocking (Query *qry, LockClauseStrength strength) |
void | applyLockingClause (Query *qry, Index rtindex, LockClauseStrength strength, LockWaitPolicy waitPolicy, bool pushedDown) |
List * | BuildOnConflictExcludedTargetlist (Relation targetrel, Index exclRelIndex) |
SortGroupClause * | makeSortGroupClauseForSetOp (Oid rescoltype, bool require_hash) |
Variables | |
PGDLLIMPORT post_parse_analyze_hook_type | post_parse_analyze_hook |
typedef void(* post_parse_analyze_hook_type) (ParseState *pstate, Query *query, JumbleState *jstate) |
Definition at line 576 of file analyze.c.
References stmt_requires_parse_analysis().
Referenced by BuildCachedPlan(), exec_bind_message(), exec_parse_message(), and exec_simple_query().
void applyLockingClause | ( | Query * | qry, |
Index | rtindex, | ||
LockClauseStrength | strength, | ||
LockWaitPolicy | waitPolicy, | ||
bool | pushedDown | ||
) |
Definition at line 3621 of file analyze.c.
References Assert, get_parse_rowmark(), lappend(), LCS_NONE, makeNode, Max, RowMarkClause::pushedDown, Query::rowMarks, RowMarkClause::rti, RowMarkClause::strength, and RowMarkClause::waitPolicy.
Referenced by markQueryForLocking(), and transformLockingClause().
Definition at line 1316 of file analyze.c.
References InvalidAttrNumber, InvalidOid, lappend(), makeNullConst(), makeTargetEntry(), makeVar(), name, NameStr, NIL, pstrdup(), RelationData::rd_att, RelationData::rd_rel, RelationGetNumberOfAttributes, and TupleDescAttr.
Referenced by rewriteTargetView(), and transformOnConflictClause().
void CheckSelectLocking | ( | Query * | qry, |
LockClauseStrength | strength | ||
) |
Definition at line 3330 of file analyze.c.
References Assert, Query::distinctClause, ereport, errcode(), errmsg(), ERROR, Query::groupClause, Query::groupingSets, Query::havingQual, LCS_asString(), LCS_NONE, NIL, and Query::setOperations.
Referenced by preprocess_rowmarks(), and transformLockingClause().
const char* LCS_asString | ( | LockClauseStrength | strength | ) |
Definition at line 3305 of file analyze.c.
References Assert, LCS_FORKEYSHARE, LCS_FORNOKEYUPDATE, LCS_FORSHARE, LCS_FORUPDATE, and LCS_NONE.
Referenced by CheckSelectLocking(), grouping_planner(), make_outerjoininfo(), transformDeclareCursorStmt(), transformLockingClause(), transformSetOperationStmt(), transformSetOperationTree(), and transformValuesClause().
SortGroupClause* makeSortGroupClauseForSetOp | ( | Oid | rescoltype, |
bool | require_hash | ||
) |
Definition at line 2047 of file analyze.c.
References SortGroupClause::eqop, get_sort_group_operators(), makeNode, SortGroupClause::nulls_first, SortGroupClause::reverse_sort, SortGroupClause::sortop, and SortGroupClause::tleSortGroupRef.
Referenced by rewriteSearchAndCycle(), and transformSetOperationTree().
Query* parse_analyze_fixedparams | ( | RawStmt * | parseTree, |
const char * | sourceText, | ||
const Oid * | paramTypes, | ||
int | numParams, | ||
QueryEnvironment * | queryEnv | ||
) |
Definition at line 105 of file analyze.c.
References Assert, free_parsestate(), IsQueryIdEnabled(), JumbleQuery(), make_parsestate(), ParseState::p_queryEnv, ParseState::p_sourcetext, pgstat_report_query_id(), post_parse_analyze_hook, setup_parse_fixed_parameters(), and transformTopLevelStmt().
Referenced by DefineView(), and pg_analyze_and_rewrite_fixedparams().
Query* parse_analyze_varparams | ( | RawStmt * | parseTree, |
const char * | sourceText, | ||
Oid ** | paramTypes, | ||
int * | numParams, | ||
QueryEnvironment * | queryEnv | ||
) |
Definition at line 145 of file analyze.c.
References Assert, check_variable_parameters(), free_parsestate(), IsQueryIdEnabled(), JumbleQuery(), make_parsestate(), ParseState::p_queryEnv, ParseState::p_sourcetext, pgstat_report_query_id(), post_parse_analyze_hook, setup_parse_variable_parameters(), and transformTopLevelStmt().
Referenced by pg_analyze_and_rewrite_varparams().
Query* parse_analyze_withcb | ( | RawStmt * | parseTree, |
const char * | sourceText, | ||
ParserSetupHook | parserSetup, | ||
void * | parserSetupArg, | ||
QueryEnvironment * | queryEnv | ||
) |
Definition at line 186 of file analyze.c.
References Assert, free_parsestate(), IsQueryIdEnabled(), JumbleQuery(), make_parsestate(), ParseState::p_queryEnv, ParseState::p_sourcetext, pgstat_report_query_id(), post_parse_analyze_hook, and transformTopLevelStmt().
Referenced by pg_analyze_and_rewrite_withcb().
Query* parse_sub_analyze | ( | Node * | parseTree, |
ParseState * | parentParseState, | ||
CommonTableExpr * | parentCTE, | ||
bool | locked_from_parent, | ||
bool | resolve_unknowns | ||
) |
Definition at line 222 of file analyze.c.
References free_parsestate(), make_parsestate(), ParseState::p_locked_from_parent, ParseState::p_parent_cte, ParseState::p_resolve_unknowns, and transformStmt().
Referenced by analyzeCTE(), transformRangeSubselect(), transformSetOperationTree(), and transformSubLink().
Definition at line 532 of file analyze.c.
References nodeTag, and RawStmt::stmt.
Referenced by analyze_requires_snapshot().
List* transformInsertRow | ( | ParseState * | pstate, |
List * | exprlist, | ||
List * | stmtcols, | ||
List * | icolumns, | ||
List * | attrnos, | ||
bool | strip_indirection | ||
) |
Definition at line 1099 of file analyze.c.
References count_rowexpr_columns(), ereport, errcode(), errhint(), errmsg(), ERROR, EXPR_KIND_INSERT_TARGET, exprLocation(), forthree, ResTarget::indirection, IsA, lappend(), lfirst, lfirst_int, lfirst_node, linitial, list_length(), list_nth(), ResTarget::location, ResTarget::name, FieldStore::newvals, NIL, parser_errposition(), SubscriptingRef::refassgnexpr, and transformAssignedExpr().
Referenced by transformInsertStmt(), and transformMergeStmt().
List* transformReturningList | ( | ParseState * | pstate, |
List * | returningList, | ||
ParseExprKind | exprKind | ||
) |
Definition at line 2652 of file analyze.c.
References ereport, errcode(), errmsg(), ERROR, exprLocation(), linitial, markTargetListOrigins(), NIL, ParseState::p_next_resno, ParseState::p_resolve_unknowns, parser_errposition(), resolveTargetListUnknowns(), and transformTargetList().
Referenced by transformDeleteStmt(), transformMergeStmt(), and transformUpdateStmt().
Query* transformStmt | ( | ParseState * | pstate, |
Node * | parseTree | ||
) |
Definition at line 396 of file analyze.c.
References CMD_UTILITY, Query::commandType, makeNode, nodeTag, SelectStmt::op, QSRC_ORIGINAL, SETOP_NONE, setQueryLocationAndLength(), transformCallStmt(), transformCreateTableAsStmt(), transformDeclareCursorStmt(), transformDeleteStmt(), transformExplainStmt(), transformInsertStmt(), transformMergeStmt(), transformPLAssignStmt(), transformReturnStmt(), transformSelectStmt(), transformSetOperationStmt(), transformUpdateStmt(), transformValuesClause(), Query::utilityStmt, and SelectStmt::valuesLists.
Referenced by interpret_AS_clause(), parse_sub_analyze(), transformCreateTableAsStmt(), transformDeclareCursorStmt(), transformInsertStmt(), transformJsonArrayQueryConstructor(), transformOptionalSelectInto(), and transformRuleStmt().
Query* transformTopLevelStmt | ( | ParseState * | pstate, |
RawStmt * | parseTree | ||
) |
Definition at line 332 of file analyze.c.
References ParseState::p_stmt_len, ParseState::p_stmt_location, RawStmt::stmt, RawStmt::stmt_len, RawStmt::stmt_location, and transformOptionalSelectInto().
Referenced by inline_function(), parse_analyze_fixedparams(), parse_analyze_varparams(), and parse_analyze_withcb().
List* transformUpdateTargetList | ( | ParseState * | pstate, |
List * | origTlist | ||
) |
Definition at line 2577 of file analyze.c.
References Alias::aliasname, attnameAttNum(), bms_add_member(), elog, ereport, errcode(), errhint(), errmsg(), ERROR, EXPR_KIND_UPDATE_SOURCE, FirstLowInvalidHeapAttributeNumber, ResTarget::indirection, InvalidAttrNumber, lfirst, lfirst_node, list_head(), lnext(), ResTarget::location, ResTarget::name, NIL, ParseNamespaceItem::p_names, ParseState::p_next_resno, ParseNamespaceItem::p_perminfo, ParseState::p_target_nsitem, ParseState::p_target_relation, parser_errposition(), RelationGetNumberOfAttributes, RelationGetRelationName, TargetEntry::resno, transformTargetList(), RTEPermissionInfo::updatedCols, and updateTargetListEntry().
Referenced by transformMergeStmt(), transformOnConflictClause(), and transformUpdateStmt().
|
extern |
Definition at line 59 of file analyze.c.
Referenced by _PG_init(), ExecCreateTableAs(), ExplainOneUtility(), ExplainQuery(), parse_analyze_fixedparams(), parse_analyze_varparams(), parse_analyze_withcb(), and PerformCursorOpen().