2
0

cluster.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*-------------------------------------------------------------------------
  2. *
  3. * cluster.h
  4. * header file for postgres cluster command stuff
  5. *
  6. * Portions Copyright (c) 1996-2022, PostgreSQL Global Development Group
  7. * Portions Copyright (c) 1994-5, Regents of the University of California
  8. *
  9. * src/include/commands/cluster.h
  10. *
  11. *-------------------------------------------------------------------------
  12. */
  13. #ifndef CLUSTER_H
  14. #define CLUSTER_H
  15. #include "nodes/parsenodes.h"
  16. #include "parser/parse_node.h"
  17. #include "storage/lock.h"
  18. #include "utils/relcache.h"
  19. /* flag bits for ClusterParams->options */
  20. #define CLUOPT_VERBOSE 0x01 /* print progress info */
  21. #define CLUOPT_RECHECK 0x02 /* recheck relation state */
  22. #define CLUOPT_RECHECK_ISCLUSTERED 0x04 /* recheck relation state for
  23. * indisclustered */
  24. /* options for CLUSTER */
  25. typedef struct ClusterParams
  26. {
  27. bits32 options; /* bitmask of CLUOPT_* */
  28. } ClusterParams;
  29. extern void cluster(ParseState *pstate, ClusterStmt *stmt, bool isTopLevel);
  30. extern void cluster_rel(Oid tableOid, Oid indexOid, ClusterParams *params);
  31. extern void check_index_is_clusterable(Relation OldHeap, Oid indexOid,
  32. LOCKMODE lockmode);
  33. extern void mark_index_clustered(Relation rel, Oid indexOid, bool is_internal);
  34. extern Oid make_new_heap(Oid OIDOldHeap, Oid NewTableSpace, Oid NewAccessMethod,
  35. char relpersistence, LOCKMODE lockmode);
  36. extern void finish_heap_swap(Oid OIDOldHeap, Oid OIDNewHeap,
  37. bool is_system_catalog,
  38. bool swap_toast_by_content,
  39. bool check_constraints,
  40. bool is_internal,
  41. TransactionId frozenXid,
  42. MultiXactId minMulti,
  43. char newrelpersistence);
  44. #endif /* CLUSTER_H */