appendinfo.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*-------------------------------------------------------------------------
  2. *
  3. * appendinfo.h
  4. * Routines for mapping expressions between append rel parent(s) and
  5. * children
  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/optimizer/appendinfo.h
  11. *
  12. *-------------------------------------------------------------------------
  13. */
  14. #ifndef APPENDINFO_H
  15. #define APPENDINFO_H
  16. #include "nodes/pathnodes.h"
  17. #include "utils/relcache.h"
  18. extern AppendRelInfo *make_append_rel_info(Relation parentrel,
  19. Relation childrel,
  20. Index parentRTindex, Index childRTindex);
  21. extern Node *adjust_appendrel_attrs(PlannerInfo *root, Node *node,
  22. int nappinfos, AppendRelInfo **appinfos);
  23. extern Node *adjust_appendrel_attrs_multilevel(PlannerInfo *root, Node *node,
  24. Relids child_relids,
  25. Relids top_parent_relids);
  26. extern Relids adjust_child_relids(Relids relids, int nappinfos,
  27. AppendRelInfo **appinfos);
  28. extern Relids adjust_child_relids_multilevel(PlannerInfo *root, Relids relids,
  29. Relids child_relids,
  30. Relids top_parent_relids);
  31. extern List *adjust_inherited_attnums(List *attnums, AppendRelInfo *context);
  32. extern List *adjust_inherited_attnums_multilevel(PlannerInfo *root,
  33. List *attnums,
  34. Index child_relid,
  35. Index top_parent_relid);
  36. extern void get_translated_update_targetlist(PlannerInfo *root, Index relid,
  37. List **processed_tlist,
  38. List **update_colnos);
  39. extern AppendRelInfo **find_appinfos_by_relids(PlannerInfo *root,
  40. Relids relids, int *nappinfos);
  41. extern void add_row_identity_var(PlannerInfo *root, Var *rowid_var,
  42. Index rtindex, const char *rowid_name);
  43. extern void add_row_identity_columns(PlannerInfo *root, Index rtindex,
  44. RangeTblEntry *target_rte,
  45. Relation target_relation);
  46. extern void distribute_row_identity_vars(PlannerInfo *root);
  47. #endif /* APPENDINFO_H */