PostgreSQL Source Code git master
Loading...
Searching...
No Matches
repack.h
Go to the documentation of this file.
1/*-------------------------------------------------------------------------
2 *
3 * repack.h
4 * header file for the REPACK command
5 *
6 * Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group
7 * Portions Copyright (c) 1994-5, Regents of the University of California
8 *
9 * src/include/commands/repack.h
10 *
11 *-------------------------------------------------------------------------
12 */
13#ifndef REPACK_H
14#define REPACK_H
15
16#include <signal.h>
17
18#include "nodes/parsenodes.h"
19#include "parser/parse_node.h"
20#include "storage/lockdefs.h"
21#include "utils/relcache.h"
22
23
24/* flag bits for ClusterParams->options */
25#define CLUOPT_VERBOSE 0x01 /* print progress info */
26#define CLUOPT_RECHECK 0x02 /* recheck relation state */
27#define CLUOPT_RECHECK_ISCLUSTERED 0x04 /* recheck relation state for
28 * indisclustered */
29#define CLUOPT_ANALYZE 0x08 /* do an ANALYZE */
30#define CLUOPT_CONCURRENT 0x10 /* allow concurrent data changes */
31
32/* options for CLUSTER */
33typedef struct ClusterParams
35 uint32 options; /* bitmask of CLUOPT_* */
37
39
40
41extern void ExecRepack(ParseState *pstate, RepackStmt *stmt, bool isTopLevel);
42
43extern void cluster_rel(RepackCommand command, Relation OldHeap, Oid indexOid,
44 ClusterParams *params, bool isTopLevel);
46 LOCKMODE lockmode);
47extern void mark_index_clustered(Relation rel, Oid indexOid, bool is_internal);
48
50 char relpersistence, LOCKMODE lockmode);
55 bool is_internal,
56 bool reindex,
59 char newrelpersistence);
60
61extern void HandleRepackMessageInterrupt(void);
62extern void ProcessRepackMessages(void);
63
64/* in repack_worker.c */
66extern bool AmRepackWorker(void);
67
68#endif /* REPACK_H */
#define PGDLLIMPORT
Definition c.h:1421
TransactionId MultiXactId
Definition c.h:746
uint32_t uint32
Definition c.h:624
uint32 TransactionId
Definition c.h:736
#define stmt
int LOCKMODE
Definition lockdefs.h:26
RepackCommand
uint64_t Datum
Definition postgres.h:70
unsigned int Oid
static int fb(int x)
bool AmRepackWorker(void)
void finish_heap_swap(Oid OIDOldHeap, Oid OIDNewHeap, bool is_system_catalog, bool swap_toast_by_content, bool check_constraints, bool is_internal, bool reindex, TransactionId frozenXid, MultiXactId cutoffMulti, char newrelpersistence)
Definition repack.c:1865
void cluster_rel(RepackCommand command, Relation OldHeap, Oid indexOid, ClusterParams *params, bool isTopLevel)
Definition repack.c:502
void check_index_is_clusterable(Relation OldHeap, Oid indexOid, LOCKMODE lockmode)
Definition repack.c:751
void ExecRepack(ParseState *pstate, RepackStmt *stmt, bool isTopLevel)
Definition repack.c:237
Oid make_new_heap(Oid OIDOldHeap, Oid NewTableSpace, Oid NewAccessMethod, char relpersistence, LOCKMODE lockmode)
Definition repack.c:1108
void HandleRepackMessageInterrupt(void)
Definition repack.c:3508
void mark_index_clustered(Relation rel, Oid indexOid, bool is_internal)
Definition repack.c:811
void RepackWorkerMain(Datum main_arg)
PGDLLIMPORT volatile sig_atomic_t RepackMessagePending
Definition repack.c:146
void ProcessRepackMessages(void)
Definition repack.c:3519
uint32 options
Definition repack.h:34