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-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 
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->options */
23 #define CLUOPT_VERBOSE 0x01 /* print progress info */
24 #define CLUOPT_RECHECK 0x02 /* recheck relation state */
25 #define CLUOPT_RECHECK_ISCLUSTERED 0x04 /* recheck relation state for
26  * indisclustered */
27 
28 /* options for CLUSTER */
29 typedef struct ClusterParams
30 {
31  bits32 options; /* bitmask of CLUOPT_* */
33 
34 extern void cluster(ParseState *pstate, ClusterStmt *stmt, bool isTopLevel);
35 extern void cluster_rel(Oid tableOid, Oid indexOid, ClusterParams *params);
36 extern void check_index_is_clusterable(Relation OldHeap, Oid indexOid,
37  LOCKMODE lockmode);
38 extern void mark_index_clustered(Relation rel, Oid indexOid, bool is_internal);
39 
40 extern Oid make_new_heap(Oid OIDOldHeap, Oid NewTableSpace, Oid NewAccessMethod,
41  char relpersistence, LOCKMODE lockmode);
42 extern void finish_heap_swap(Oid OIDOldHeap, Oid OIDNewHeap,
43  bool is_system_catalog,
44  bool swap_toast_by_content,
45  bool check_constraints,
46  bool is_internal,
47  TransactionId frozenXid,
48  MultiXactId minMulti,
49  char newrelpersistence);
50 
51 #endif /* CLUSTER_H */
TransactionId MultiXactId
Definition: c.h:608
uint32 bits32
Definition: c.h:461
uint32 TransactionId
Definition: c.h:598
void cluster_rel(Oid tableOid, Oid indexOid, ClusterParams *params)
Definition: cluster.c:310
void check_index_is_clusterable(Relation OldHeap, Oid indexOid, LOCKMODE lockmode)
Definition: cluster.c:498
Oid make_new_heap(Oid OIDOldHeap, Oid NewTableSpace, Oid NewAccessMethod, char relpersistence, LOCKMODE lockmode)
Definition: cluster.c:686
struct ClusterParams ClusterParams
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:1419
void cluster(ParseState *pstate, ClusterStmt *stmt, bool isTopLevel)
Definition: cluster.c:108
void mark_index_clustered(Relation rel, Oid indexOid, bool is_internal)
Definition: cluster.c:558
int LOCKMODE
Definition: lockdefs.h:26
unsigned int Oid
Definition: postgres_ext.h:31
bits32 options
Definition: cluster.h:30