PostgreSQL Source Code  git master
cluster.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * cluster.h
4  * header file for postgres cluster command stuff
5  *
6  * Portions Copyright (c) 1996-2021, 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 "parser/parse_node.h"
18 #include "storage/lock.h"
19 #include "utils/relcache.h"
20 
21 
22 /* flag bits for ClusterParams->flags */
23 #define CLUOPT_RECHECK 0x01 /* recheck relation state */
24 #define CLUOPT_VERBOSE 0x02 /* print progress info */
25 
26 /* options for CLUSTER */
27 typedef struct ClusterParams
28 {
29  bits32 options; /* bitmask of CLUOPT_* */
31 
32 extern void cluster(ParseState *pstate, ClusterStmt *stmt, bool isTopLevel);
33 extern void cluster_rel(Oid tableOid, Oid indexOid, ClusterParams *params);
34 extern void check_index_is_clusterable(Relation OldHeap, Oid indexOid,
35  bool recheck, LOCKMODE lockmode);
36 extern void mark_index_clustered(Relation rel, Oid indexOid, bool is_internal);
37 
38 extern Oid make_new_heap(Oid OIDOldHeap, Oid NewTableSpace, Oid NewAccessMethod,
39  char relpersistence, LOCKMODE lockmode);
40 extern void finish_heap_swap(Oid OIDOldHeap, Oid OIDNewHeap,
41  bool is_system_catalog,
42  bool swap_toast_by_content,
43  bool check_constraints,
44  bool is_internal,
45  TransactionId frozenXid,
46  MultiXactId minMulti,
47  char newrelpersistence);
48 
49 #endif /* CLUSTER_H */
struct ClusterParams ClusterParams
uint32 TransactionId
Definition: c.h:587
int LOCKMODE
Definition: lockdefs.h:26
void cluster_rel(Oid tableOid, Oid indexOid, ClusterParams *params)
Definition: cluster.c:277
unsigned int Oid
Definition: postgres_ext.h:31
void finish_heap_swap(Oid OIDOldHeap, Oid OIDNewHeap, bool is_system_catalog, bool swap_toast_by_content, bool check_constraints, bool is_internal, TransactionId frozenXid, MultiXactId minMulti, char newrelpersistence)
Definition: cluster.c:1362
void check_index_is_clusterable(Relation OldHeap, Oid indexOid, bool recheck, LOCKMODE lockmode)
Definition: cluster.c:443
void mark_index_clustered(Relation rel, Oid indexOid, bool is_internal)
Definition: cluster.c:503
Oid make_new_heap(Oid OIDOldHeap, Oid NewTableSpace, Oid NewAccessMethod, char relpersistence, LOCKMODE lockmode)
Definition: cluster.c:631
bits32 options
Definition: cluster.h:29
TransactionId MultiXactId
Definition: c.h:597
uint32 bits32
Definition: c.h:450
void cluster(ParseState *pstate, ClusterStmt *stmt, bool isTopLevel)
Definition: cluster.c:103