gooderp18绿色标准版
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

70 line
1.8KB

  1. /*-------------------------------------------------------------------------
  2. *
  3. * parsetree.h
  4. * Routines to access various components and subcomponents of
  5. * parse trees.
  6. *
  7. *
  8. * Portions Copyright (c) 1996-2019, PostgreSQL Global Development Group
  9. * Portions Copyright (c) 1994, Regents of the University of California
  10. *
  11. * src/include/parser/parsetree.h
  12. *
  13. *-------------------------------------------------------------------------
  14. */
  15. #ifndef PARSETREE_H
  16. #define PARSETREE_H
  17. #include "nodes/parsenodes.h"
  18. /* ----------------
  19. * range table operations
  20. * ----------------
  21. */
  22. /*
  23. * rt_fetch
  24. *
  25. * NB: this will crash and burn if handed an out-of-range RT index
  26. */
  27. #define rt_fetch(rangetable_index, rangetable) \
  28. ((RangeTblEntry *) list_nth(rangetable, (rangetable_index)-1))
  29. /*
  30. * Given an RTE and an attribute number, return the appropriate
  31. * variable name or alias for that attribute of that RTE.
  32. */
  33. extern char *get_rte_attribute_name(RangeTblEntry *rte, AttrNumber attnum);
  34. /*
  35. * Given an RTE and an attribute number, return the appropriate
  36. * type and typemod info for that attribute of that RTE.
  37. */
  38. extern void get_rte_attribute_type(RangeTblEntry *rte, AttrNumber attnum,
  39. Oid *vartype, int32 *vartypmod, Oid *varcollid);
  40. /*
  41. * Check whether an attribute of an RTE has been dropped (note that
  42. * get_rte_attribute_type will fail on such an attr)
  43. */
  44. extern bool get_rte_attribute_is_dropped(RangeTblEntry *rte,
  45. AttrNumber attnum);
  46. /* ----------------
  47. * target list operations
  48. * ----------------
  49. */
  50. extern TargetEntry *get_tle_by_resno(List *tlist, AttrNumber resno);
  51. /* ----------------
  52. * FOR UPDATE/SHARE info
  53. * ----------------
  54. */
  55. extern RowMarkClause *get_parse_rowmark(Query *qry, Index rtindex);
  56. #endif /* PARSETREE_H */
上海开阖软件有限公司 沪ICP备12045867号-1