PostgreSQL Source Code  git master
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * analyze.h
4  * parse analysis for optimizable statements
5  *
6  *
7  * Portions Copyright (c) 1996-2024, PostgreSQL Global Development Group
8  * Portions Copyright (c) 1994, Regents of the University of California
9  *
10  * src/include/parser/analyze.h
11  *
12  *-------------------------------------------------------------------------
13  */
14 #ifndef ANALYZE_H
15 #define ANALYZE_H
17 #include "nodes/params.h"
18 #include "nodes/queryjumble.h"
19 #include "parser/parse_node.h"
21 /* Hook for plugins to get control at end of parse analysis */
22 typedef void (*post_parse_analyze_hook_type) (ParseState *pstate,
23  Query *query,
24  JumbleState *jstate);
28 extern Query *parse_analyze_fixedparams(RawStmt *parseTree, const char *sourceText,
29  const Oid *paramTypes, int numParams, QueryEnvironment *queryEnv);
30 extern Query *parse_analyze_varparams(RawStmt *parseTree, const char *sourceText,
31  Oid **paramTypes, int *numParams, QueryEnvironment *queryEnv);
32 extern Query *parse_analyze_withcb(RawStmt *parseTree, const char *sourceText,
33  ParserSetupHook parserSetup,
34  void *parserSetupArg,
35  QueryEnvironment *queryEnv);
37 extern Query *parse_sub_analyze(Node *parseTree, ParseState *parentParseState,
38  CommonTableExpr *parentCTE,
39  bool locked_from_parent,
40  bool resolve_unknowns);
42 extern List *transformInsertRow(ParseState *pstate, List *exprlist,
43  List *stmtcols, List *icolumns, List *attrnos,
44  bool strip_indirection);
46  List *origTlist);
47 extern List *transformReturningList(ParseState *pstate, List *returningList,
48  ParseExprKind exprKind);
49 extern Query *transformTopLevelStmt(ParseState *pstate, RawStmt *parseTree);
50 extern Query *transformStmt(ParseState *pstate, Node *parseTree);
52 extern bool stmt_requires_parse_analysis(RawStmt *parseTree);
53 extern bool analyze_requires_snapshot(RawStmt *parseTree);
55 extern const char *LCS_asString(LockClauseStrength strength);
56 extern void CheckSelectLocking(Query *qry, LockClauseStrength strength);
57 extern void applyLockingClause(Query *qry, Index rtindex,
58  LockClauseStrength strength,
59  LockWaitPolicy waitPolicy, bool pushedDown);
62  Index exclRelIndex);
64 extern SortGroupClause *makeSortGroupClauseForSetOp(Oid rescoltype, bool require_hash);
66 #endif /* ANALYZE_H */
Query * parse_analyze_withcb(RawStmt *parseTree, const char *sourceText, ParserSetupHook parserSetup, void *parserSetupArg, QueryEnvironment *queryEnv)
Definition: analyze.c:185
List * transformUpdateTargetList(ParseState *pstate, List *origTlist)
Definition: analyze.c:2485
Query * parse_sub_analyze(Node *parseTree, ParseState *parentParseState, CommonTableExpr *parentCTE, bool locked_from_parent, bool resolve_unknowns)
Definition: analyze.c:221
List * transformInsertRow(ParseState *pstate, List *exprlist, List *stmtcols, List *icolumns, List *attrnos, bool strip_indirection)
Definition: analyze.c:1008
void CheckSelectLocking(Query *qry, LockClauseStrength strength)
Definition: analyze.c:3238
Query * transformTopLevelStmt(ParseState *pstate, RawStmt *parseTree)
Definition: analyze.c:248
bool analyze_requires_snapshot(RawStmt *parseTree)
Definition: analyze.c:485
void(* post_parse_analyze_hook_type)(ParseState *pstate, Query *query, JumbleState *jstate)
Definition: analyze.h:22
void applyLockingClause(Query *qry, Index rtindex, LockClauseStrength strength, LockWaitPolicy waitPolicy, bool pushedDown)
Definition: analyze.c:3529
List * BuildOnConflictExcludedTargetlist(Relation targetrel, Index exclRelIndex)
Definition: analyze.c:1225
SortGroupClause * makeSortGroupClauseForSetOp(Oid rescoltype, bool require_hash)
Definition: analyze.c:1956
const char * LCS_asString(LockClauseStrength strength)
Definition: analyze.c:3213
Query * transformStmt(ParseState *pstate, Node *parseTree)
Definition: analyze.c:311
Query * parse_analyze_varparams(RawStmt *parseTree, const char *sourceText, Oid **paramTypes, int *numParams, QueryEnvironment *queryEnv)
Definition: analyze.c:144
List * transformReturningList(ParseState *pstate, List *returningList, ParseExprKind exprKind)
Definition: analyze.c:2560
Query * parse_analyze_fixedparams(RawStmt *parseTree, const char *sourceText, const Oid *paramTypes, int numParams, QueryEnvironment *queryEnv)
Definition: analyze.c:104
bool stmt_requires_parse_analysis(RawStmt *parseTree)
Definition: analyze.c:441
PGDLLIMPORT post_parse_analyze_hook_type post_parse_analyze_hook
Definition: analyze.c:58
Definition: c.h:1316
unsigned int Index
Definition: c.h:614
Definition: lockoptions.h:37
Definition: lockoptions.h:22
void(* ParserSetupHook)(struct ParseState *pstate, void *arg)
Definition: params.h:108
Definition: parse_node.h:39
unsigned int Oid
Definition: postgres_ext.h:31
Definition: pg_list.h:54
Definition: nodes.h:129