ruleutils.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*-------------------------------------------------------------------------
  2. *
  3. * ruleutils.h
  4. * Declarations for ruleutils.c
  5. *
  6. * Portions Copyright (c) 1996-2022, PostgreSQL Global Development Group
  7. * Portions Copyright (c) 1994, Regents of the University of California
  8. *
  9. * src/include/utils/ruleutils.h
  10. *
  11. *-------------------------------------------------------------------------
  12. */
  13. #ifndef RULEUTILS_H
  14. #define RULEUTILS_H
  15. #include "nodes/nodes.h"
  16. #include "nodes/parsenodes.h"
  17. #include "nodes/pg_list.h"
  18. struct Plan; /* avoid including plannodes.h here */
  19. struct PlannedStmt;
  20. /* Flags for pg_get_indexdef_columns_extended() */
  21. #define RULE_INDEXDEF_PRETTY 0x01
  22. #define RULE_INDEXDEF_KEYS_ONLY 0x02 /* ignore included attributes */
  23. extern char *pg_get_indexdef_string(Oid indexrelid);
  24. extern char *pg_get_indexdef_columns(Oid indexrelid, bool pretty);
  25. extern char *pg_get_indexdef_columns_extended(Oid indexrelid,
  26. bits16 flags);
  27. extern char *pg_get_querydef(Query *query, bool pretty);
  28. extern char *pg_get_partkeydef_columns(Oid relid, bool pretty);
  29. extern char *pg_get_partconstrdef_string(Oid partitionId, char *aliasname);
  30. extern char *pg_get_constraintdef_command(Oid constraintId);
  31. extern char *deparse_expression(Node *expr, List *dpcontext,
  32. bool forceprefix, bool showimplicit);
  33. extern List *deparse_context_for(const char *aliasname, Oid relid);
  34. extern List *deparse_context_for_plan_tree(struct PlannedStmt *pstmt,
  35. List *rtable_names);
  36. extern List *set_deparse_context_plan(List *dpcontext,
  37. struct Plan *plan, List *ancestors);
  38. extern List *select_rtable_names_for_explain(List *rtable,
  39. Bitmapset *rels_used);
  40. extern char *generate_collation_name(Oid collid);
  41. extern char *generate_opclass_name(Oid opclass);
  42. extern char *get_range_partbound_string(List *bound_datums);
  43. extern char *pg_get_statisticsobjdef_string(Oid statextid);
  44. #endif /* RULEUTILS_H */