1/*-------------------------------------------------------------------------
2 *
3 * analyze.h
4 * parse analysis for optimizable statements
5 *
6 *
7 * Portions Copyright (c) 1996-2019, 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
19/* Hook for plugins to get control at end of parse analysis */
20typedef void (*post_parse_analyze_hook_type) (ParseState *pstate,
21 Query *query);
22extern PGDLLIMPORT post_parse_analyze_hook_type post_parse_analyze_hook;
23
24
25extern Query *parse_analyze(RawStmt *parseTree, const char *sourceText,
26 Oid *paramTypes, int numParams, QueryEnvironment *queryEnv);
27extern Query *parse_analyze_varparams(RawStmt *parseTree, const char *sourceText,
28 Oid **paramTypes, int *numParams);
29
30extern Query *parse_sub_analyze(Node *parseTree, ParseState *parentParseState,
31 CommonTableExpr *parentCTE,
32 bool locked_from_parent,
33 bool resolve_unknowns);
34
35extern Query *transformTopLevelStmt(ParseState *pstate, RawStmt *parseTree);
36extern Query *transformStmt(ParseState *pstate, Node *parseTree);
37
38extern bool analyze_requires_snapshot(RawStmt *parseTree);
39
40extern const char *LCS_asString(LockClauseStrength strength);
41extern void CheckSelectLocking(Query *qry, LockClauseStrength strength);
42extern void applyLockingClause(Query *qry, Index rtindex,
43 LockClauseStrength strength,
44 LockWaitPolicy waitPolicy, bool pushedDown);
45
46extern List *BuildOnConflictExcludedTargetlist(Relation targetrel,
47 Index exclRelIndex);
48
49#endif /* ANALYZE_H */
50