PostgreSQL Source Code git master
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
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-2025, 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 */
29typedef struct ClusterParams
31 bits32 options; /* bitmask of CLUOPT_* */
33
34extern void cluster(ParseState *pstate, ClusterStmt *stmt, bool isTopLevel);
35extern void cluster_rel(Relation OldHeap, Oid indexOid, ClusterParams *params);
36extern void check_index_is_clusterable(Relation OldHeap, Oid indexOid,
37 LOCKMODE lockmode);
38extern void mark_index_clustered(Relation rel, Oid indexOid, bool is_internal);
39
40extern Oid make_new_heap(Oid OIDOldHeap, Oid NewTableSpace, Oid NewAccessMethod,
41 char relpersistence, LOCKMODE lockmode);
42extern 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 cutoffMulti,
49 char newrelpersistence);
50
51#endif /* CLUSTER_H */
TransactionId MultiXactId
Definition: c.h:619
uint32 bits32
Definition: c.h:497
uint32 TransactionId
Definition: c.h:609
void check_index_is_clusterable(Relation OldHeap, Oid indexOid, LOCKMODE lockmode)
Definition: cluster.c:494
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 cutoffMulti, char newrelpersistence)
Definition: cluster.c:1440
void cluster_rel(Relation OldHeap, Oid indexOid, ClusterParams *params)
Definition: cluster.c:311
Oid make_new_heap(Oid OIDOldHeap, Oid NewTableSpace, Oid NewAccessMethod, char relpersistence, LOCKMODE lockmode)
Definition: cluster.c:705
struct ClusterParams ClusterParams
void cluster(ParseState *pstate, ClusterStmt *stmt, bool isTopLevel)
Definition: cluster.c:107
void mark_index_clustered(Relation rel, Oid indexOid, bool is_internal)
Definition: cluster.c:554
#define stmt
Definition: indent_codes.h:59
int LOCKMODE
Definition: lockdefs.h:26
unsigned int Oid
Definition: postgres_ext.h:32
bits32 options
Definition: cluster.h:30