1 /*-------------------------------------------------------------------------
2  *
3  * cluster.h
4  *	  header file for postgres cluster command stuff
5  *
6  * Portions Copyright (c) 1996-2016, 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 
16 #include "nodes/parsenodes.h"
17 #include "storage/lock.h"
18 #include "utils/relcache.h"
19 
20 
21 extern void cluster(ClusterStmt *stmt, bool isTopLevel);
22 extern void cluster_rel(Oid tableOid, Oid indexOid, bool recheck,
23 			bool verbose);
24 extern void check_index_is_clusterable(Relation OldHeap, Oid indexOid,
25 						   bool recheck, LOCKMODE lockmode);
26 extern void mark_index_clustered(Relation rel, Oid indexOid, bool is_internal);
27 
28 extern Oid make_new_heap(Oid OIDOldHeap, Oid NewTableSpace, char relpersistence,
29 			  LOCKMODE lockmode);
30 extern void finish_heap_swap(Oid OIDOldHeap, Oid OIDNewHeap,
31 				 bool is_system_catalog,
32 				 bool swap_toast_by_content,
33 				 bool check_constraints,
34 				 bool is_internal,
35 				 TransactionId frozenXid,
36 				 MultiXactId minMulti,
37 				 char newrelpersistence);
38 
39 #endif   /* CLUSTER_H */
40