PostgreSQL Source Code  git master
storage.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * storage.h
4  * prototypes for functions in backend/catalog/storage.c
5  *
6  *
7  * Portions Copyright (c) 1996-2022, PostgreSQL Global Development Group
8  * Portions Copyright (c) 1994, Regents of the University of California
9  *
10  * src/include/catalog/storage.h
11  *
12  *-------------------------------------------------------------------------
13  */
14 #ifndef STORAGE_H
15 #define STORAGE_H
16 
17 #include "storage/block.h"
18 #include "storage/relfilenode.h"
19 #include "storage/smgr.h"
20 #include "utils/relcache.h"
21 
22 /* GUC variables */
24 
26  char relpersistence,
27  bool register_delete);
28 extern void RelationDropStorage(Relation rel);
29 extern void RelationPreserveStorage(RelFileNode rnode, bool atCommit);
30 extern void RelationPreTruncate(Relation rel);
31 extern void RelationTruncate(Relation rel, BlockNumber nblocks);
32 extern void RelationCopyStorage(SMgrRelation src, SMgrRelation dst,
33  ForkNumber forkNum, char relpersistence);
34 extern bool RelFileNodeSkippingWAL(RelFileNode rnode);
35 extern Size EstimatePendingSyncsSpace(void);
36 extern void SerializePendingSyncs(Size maxSize, char *startAddress);
37 extern void RestorePendingSyncs(char *startAddress);
38 
39 /*
40  * These functions used to be in storage/smgr/smgr.c, which explains the
41  * naming
42  */
43 extern void smgrDoPendingDeletes(bool isCommit);
44 extern void smgrDoPendingSyncs(bool isCommit, bool isParallelWorker);
45 extern int smgrGetPendingDeletes(bool forCommit, RelFileNode **ptr);
46 extern void AtSubCommit_smgr(void);
47 extern void AtSubAbort_smgr(void);
48 extern void PostPrepare_smgr(void);
49 
50 #endif /* STORAGE_H */
uint32 BlockNumber
Definition: block.h:31
#define PGDLLIMPORT
Definition: c.h:1331
size_t Size
Definition: c.h:540
ForkNumber
Definition: relpath.h:41
void RelationPreTruncate(Relation rel)
Definition: storage.c:423
void SerializePendingSyncs(Size maxSize, char *startAddress)
Definition: storage.c:577
void AtSubCommit_smgr(void)
Definition: storage.c:931
SMgrRelation RelationCreateStorage(RelFileNode rnode, char relpersistence, bool register_delete)
Definition: storage.c:120
int smgrGetPendingDeletes(bool forCommit, RelFileNode **ptr)
Definition: storage.c:869
Size EstimatePendingSyncsSpace(void)
Definition: storage.c:564
void AtSubAbort_smgr(void)
Definition: storage.c:951
void RelationCopyStorage(SMgrRelation src, SMgrRelation dst, ForkNumber forkNum, char relpersistence)
Definition: storage.c:451
void RelationPreserveStorage(RelFileNode rnode, bool atCommit)
Definition: storage.c:250
void PostPrepare_smgr(void)
Definition: storage.c:910
bool RelFileNodeSkippingWAL(RelFileNode rnode)
Definition: storage.c:550
void RestorePendingSyncs(char *startAddress)
Definition: storage.c:628
void RelationDropStorage(Relation rel)
Definition: storage.c:205
void RelationTruncate(Relation rel, BlockNumber nblocks)
Definition: storage.c:287
PGDLLIMPORT int wal_skip_threshold
Definition: storage.c:38
void smgrDoPendingSyncs(bool isCommit, bool isParallelWorker)
Definition: storage.c:717
void smgrDoPendingDeletes(bool isCommit)
Definition: storage.c:649