var.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*-------------------------------------------------------------------------
  2. *
  3. * var.h
  4. * prototypes for optimizer/util/var.c.
  5. *
  6. *
  7. * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
  8. * Portions Copyright (c) 1994, Regents of the University of California
  9. *
  10. * src/include/optimizer/var.h
  11. *
  12. *-------------------------------------------------------------------------
  13. */
  14. #ifndef VAR_H
  15. #define VAR_H
  16. #include "nodes/relation.h"
  17. /* Bits that can be OR'd into the flags argument of pull_var_clause() */
  18. #define PVC_INCLUDE_AGGREGATES 0x0001 /* include Aggrefs in output list */
  19. #define PVC_RECURSE_AGGREGATES 0x0002 /* recurse into Aggref arguments */
  20. #define PVC_INCLUDE_WINDOWFUNCS 0x0004 /* include WindowFuncs in output list */
  21. #define PVC_RECURSE_WINDOWFUNCS 0x0008 /* recurse into WindowFunc arguments */
  22. #define PVC_INCLUDE_PLACEHOLDERS 0x0010 /* include PlaceHolderVars in
  23. * output list */
  24. #define PVC_RECURSE_PLACEHOLDERS 0x0020 /* recurse into PlaceHolderVar
  25. * arguments */
  26. extern Relids pull_varnos(Node *node);
  27. extern Relids pull_varnos_of_level(Node *node, int levelsup);
  28. extern void pull_varattnos(Node *node, Index varno, Bitmapset **varattnos);
  29. extern List *pull_vars_of_level(Node *node, int levelsup);
  30. extern bool contain_var_clause(Node *node);
  31. extern bool contain_vars_of_level(Node *node, int levelsup);
  32. extern int locate_var_of_level(Node *node, int levelsup);
  33. extern List *pull_var_clause(Node *node, int flags);
  34. extern Node *flatten_join_alias_vars(PlannerInfo *root, Node *node);
  35. #endif /* VAR_H */