PostgreSQL Source Code  git master
analyze.h
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-2021, 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
16 
17 #include "parser/parse_node.h"
18 #include "utils/queryjumble.h"
19 
20 /* Hook for plugins to get control at end of parse analysis */
21 typedef void (*post_parse_analyze_hook_type) (ParseState *pstate,
22  Query *query,
23  JumbleState *jstate);
25 
26 
27 extern Query *parse_analyze(RawStmt *parseTree, const char *sourceText,
28  Oid *paramTypes, int numParams, QueryEnvironment *queryEnv);
29 extern Query *parse_analyze_varparams(RawStmt *parseTree, const char *sourceText,
30  Oid **paramTypes, int *numParams);
31 
32 extern Query *parse_sub_analyze(Node *parseTree, ParseState *parentParseState,
33  CommonTableExpr *parentCTE,
34  bool locked_from_parent,
35  bool resolve_unknowns);
36 
37 extern Query *transformTopLevelStmt(ParseState *pstate, RawStmt *parseTree);
38 extern Query *transformStmt(ParseState *pstate, Node *parseTree);
39 
40 extern bool analyze_requires_snapshot(RawStmt *parseTree);
41 
42 extern const char *LCS_asString(LockClauseStrength strength);
43 extern void CheckSelectLocking(Query *qry, LockClauseStrength strength);
44 extern void applyLockingClause(Query *qry, Index rtindex,
45  LockClauseStrength strength,
46  LockWaitPolicy waitPolicy, bool pushedDown);
47 
49  Index exclRelIndex);
50 
51 extern SortGroupClause *makeSortGroupClauseForSetOp(Oid rescoltype, bool require_hash);
52 
53 #endif /* ANALYZE_H */
Query * parse_sub_analyze(Node *parseTree, ParseState *parentParseState, CommonTableExpr *parentCTE, bool locked_from_parent, bool resolve_unknowns)
Definition: analyze.c:186
const char * LCS_asString(LockClauseStrength strength)
Definition: analyze.c:3078
Query * parse_analyze(RawStmt *parseTree, const char *sourceText, Oid *paramTypes, int numParams, QueryEnvironment *queryEnv)
Definition: analyze.c:110
PGDLLIMPORT post_parse_analyze_hook_type post_parse_analyze_hook
Definition: analyze.c:58
void applyLockingClause(Query *qry, Index rtindex, LockClauseStrength strength, LockWaitPolicy waitPolicy, bool pushedDown)
Definition: analyze.c:3356
Query * transformTopLevelStmt(ParseState *pstate, RawStmt *parseTree)
Definition: analyze.c:213
Query * transformStmt(ParseState *pstate, Node *parseTree)
Definition: analyze.c:276
Definition: nodes.h:536
unsigned int Oid
Definition: postgres_ext.h:31
SortGroupClause * makeSortGroupClauseForSetOp(Oid rescoltype, bool require_hash)
Definition: analyze.c:1860
#define PGDLLIMPORT
Definition: c.h:1317
void(* post_parse_analyze_hook_type)(ParseState *pstate, Query *query, JumbleState *jstate)
Definition: analyze.h:21
Query * parse_analyze_varparams(RawStmt *parseTree, const char *sourceText, Oid **paramTypes, int *numParams)
Definition: analyze.c:150
void CheckSelectLocking(Query *qry, LockClauseStrength strength)
Definition: analyze.c:3103
LockClauseStrength
Definition: lockoptions.h:21
unsigned int Index
Definition: c.h:549
List * BuildOnConflictExcludedTargetlist(Relation targetrel, Index exclRelIndex)
Definition: analyze.c:1127
bool analyze_requires_snapshot(RawStmt *parseTree)
Definition: analyze.c:388
Definition: pg_list.h:50
LockWaitPolicy
Definition: lockoptions.h:36