codekingpro/portable-devtools
115k
1/*-------------------------------------------------------------------------2 *3 * analyze.h4 * parse analysis for optimizable statements5 *6 *7 * Portions Copyright (c) 1996-2023, PostgreSQL Global Development Group8 * Portions Copyright (c) 1994, Regents of the University of California9 *10 * src/include/parser/analyze.h11 *12 *-------------------------------------------------------------------------13 */14#ifndef ANALYZE_H15#define ANALYZE_H16 17#include "nodes/params.h"18#include "nodes/queryjumble.h"19#include "parser/parse_node.h"20 21/* Hook for plugins to get control at end of parse analysis */22typedef void (*post_parse_analyze_hook_type) (ParseState *pstate,23 Query *query,24 JumbleState *jstate);25extern PGDLLIMPORT post_parse_analyze_hook_type post_parse_analyze_hook;26 27 28extern Query *parse_analyze_fixedparams(RawStmt *parseTree, const char *sourceText,29 const Oid *paramTypes, int numParams, QueryEnvironment *queryEnv);30extern Query *parse_analyze_varparams(RawStmt *parseTree, const char *sourceText,31 Oid **paramTypes, int *numParams, QueryEnvironment *queryEnv);32extern Query *parse_analyze_withcb(RawStmt *parseTree, const char *sourceText,33 ParserSetupHook parserSetup,34 void *parserSetupArg,35 QueryEnvironment *queryEnv);36 37extern Query *parse_sub_analyze(Node *parseTree, ParseState *parentParseState,38 CommonTableExpr *parentCTE,39 bool locked_from_parent,40 bool resolve_unknowns);41 42extern List *transformInsertRow(ParseState *pstate, List *exprlist,43 List *stmtcols, List *icolumns, List *attrnos,44 bool strip_indirection);45extern List *transformUpdateTargetList(ParseState *pstate,46 List *origTlist);47extern Query *transformTopLevelStmt(ParseState *pstate, RawStmt *parseTree);48extern Query *transformStmt(ParseState *pstate, Node *parseTree);49 50extern bool stmt_requires_parse_analysis(RawStmt *parseTree);51extern bool analyze_requires_snapshot(RawStmt *parseTree);52 53extern const char *LCS_asString(LockClauseStrength strength);54extern void CheckSelectLocking(Query *qry, LockClauseStrength strength);55extern void applyLockingClause(Query *qry, Index rtindex,56 LockClauseStrength strength,57 LockWaitPolicy waitPolicy, bool pushedDown);58 59extern List *BuildOnConflictExcludedTargetlist(Relation targetrel,60 Index exclRelIndex);61 62extern SortGroupClause *makeSortGroupClauseForSetOp(Oid rescoltype, bool require_hash);63 64#endif /* ANALYZE_H */65 