analyze.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*-------------------------------------------------------------------------
  2. *
  3. * analyze.h
  4. * parse analysis for optimizable statements
  5. *
  6. *
  7. * Portions Copyright (c) 1996-2022, 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. #include "nodes/params.h"
  17. #include "parser/parse_node.h"
  18. #include "utils/queryjumble.h"
  19. /* Hook for plugins to get control at end of parse analysis */
  20. typedef void (*post_parse_analyze_hook_type) (ParseState *pstate,
  21. Query *query,
  22. JumbleState *jstate);
  23. extern PGDLLIMPORT post_parse_analyze_hook_type post_parse_analyze_hook;
  24. extern Query *parse_analyze_fixedparams(RawStmt *parseTree, const char *sourceText,
  25. const Oid *paramTypes, int numParams, QueryEnvironment *queryEnv);
  26. extern Query *parse_analyze_varparams(RawStmt *parseTree, const char *sourceText,
  27. Oid **paramTypes, int *numParams, QueryEnvironment *queryEnv);
  28. extern Query *parse_analyze_withcb(RawStmt *parseTree, const char *sourceText,
  29. ParserSetupHook parserSetup,
  30. void *parserSetupArg,
  31. QueryEnvironment *queryEnv);
  32. extern Query *parse_sub_analyze(Node *parseTree, ParseState *parentParseState,
  33. CommonTableExpr *parentCTE,
  34. bool locked_from_parent,
  35. bool resolve_unknowns);
  36. extern List *transformInsertRow(ParseState *pstate, List *exprlist,
  37. List *stmtcols, List *icolumns, List *attrnos,
  38. bool strip_indirection);
  39. extern List *transformUpdateTargetList(ParseState *pstate,
  40. List *targetList);
  41. extern Query *transformTopLevelStmt(ParseState *pstate, RawStmt *parseTree);
  42. extern Query *transformStmt(ParseState *pstate, Node *parseTree);
  43. extern bool analyze_requires_snapshot(RawStmt *parseTree);
  44. extern const char *LCS_asString(LockClauseStrength strength);
  45. extern void CheckSelectLocking(Query *qry, LockClauseStrength strength);
  46. extern void applyLockingClause(Query *qry, Index rtindex,
  47. LockClauseStrength strength,
  48. LockWaitPolicy waitPolicy, bool pushedDown);
  49. extern List *BuildOnConflictExcludedTargetlist(Relation targetrel,
  50. Index exclRelIndex);
  51. extern SortGroupClause *makeSortGroupClauseForSetOp(Oid rescoltype, bool require_hash);
  52. #endif /* ANALYZE_H */