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-2020, 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 */
23 extern int wal_skip_threshold;
24 
25 extern SMgrRelation RelationCreateStorage(RelFileNode rnode, char relpersistence);
26 extern void RelationDropStorage(Relation rel);
27 extern void RelationPreserveStorage(RelFileNode rnode, bool atCommit);
28 extern void RelationPreTruncate(Relation rel);
29 extern void RelationTruncate(Relation rel, BlockNumber nblocks);
30 extern void RelationCopyStorage(SMgrRelation src, SMgrRelation dst,
31  ForkNumber forkNum, char relpersistence);
32 extern bool RelFileNodeSkippingWAL(RelFileNode rnode);
33 extern Size EstimatePendingSyncsSpace(void);
34 extern void SerializePendingSyncs(Size maxSize, char *startAddress);
35 extern void RestorePendingSyncs(char *startAddress);
36 
37 /*
38  * These functions used to be in storage/smgr/smgr.c, which explains the
39  * naming
40  */
41 extern void smgrDoPendingDeletes(bool isCommit);
42 extern void smgrDoPendingSyncs(bool isCommit, bool isParallelWorker);
43 extern int smgrGetPendingDeletes(bool forCommit, RelFileNode **ptr);
44 extern void AtSubCommit_smgr(void);
45 extern void AtSubAbort_smgr(void);
46 extern void PostPrepare_smgr(void);
47 
48 #endif /* STORAGE_H */
void AtSubCommit_smgr(void)
Definition: storage.c:878
void RelationPreTruncate(Relation rel)
Definition: storage.c:386
void PostPrepare_smgr(void)
Definition: storage.c:857
uint32 BlockNumber
Definition: block.h:31
int smgrGetPendingDeletes(bool forCommit, RelFileNode **ptr)
Definition: storage.c:816
void smgrDoPendingDeletes(bool isCommit)
Definition: storage.c:595
void RestorePendingSyncs(char *startAddress)
Definition: storage.c:574
void SerializePendingSyncs(Size maxSize, char *startAddress)
Definition: storage.c:523
void AtSubAbort_smgr(void)
Definition: storage.c:898
void RelationCopyStorage(SMgrRelation src, SMgrRelation dst, ForkNumber forkNum, char relpersistence)
Definition: storage.c:408
ForkNumber
Definition: relpath.h:40
SMgrRelation RelationCreateStorage(RelFileNode rnode, char relpersistence)
Definition: storage.c:118
void RelationPreserveStorage(RelFileNode rnode, bool atCommit)
Definition: storage.c:240
void smgrDoPendingSyncs(bool isCommit, bool isParallelWorker)
Definition: storage.c:664
bool RelFileNodeSkippingWAL(RelFileNode rnode)
Definition: storage.c:496
size_t Size
Definition: c.h:466
void RelationDropStorage(Relation rel)
Definition: storage.c:195
Size EstimatePendingSyncsSpace(void)
Definition: storage.c:510
int wal_skip_threshold
Definition: storage.c:38
void RelationTruncate(Relation rel, BlockNumber nblocks)
Definition: storage.c:277