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-2023, 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/relfilelocator.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(RelFileLocator rlocator, 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 RelFileLocatorSkippingWAL(RelFileLocator rlocator);
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, RelFileLocator **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:1303
size_t Size
Definition: c.h:589
ForkNumber
Definition: relpath.h:48
void RelationPreserveStorage(RelFileLocator rlocator, bool atCommit)
Definition: storage.c:250
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:932
Size EstimatePendingSyncsSpace(void)
Definition: storage.c:564
void AtSubAbort_smgr(void)
Definition: storage.c:952
void RelationCopyStorage(SMgrRelation src, SMgrRelation dst, ForkNumber forkNum, char relpersistence)
Definition: storage.c:451
bool RelFileLocatorSkippingWAL(RelFileLocator rlocator)
Definition: storage.c:550
int smgrGetPendingDeletes(bool forCommit, RelFileLocator **ptr)
Definition: storage.c:870
void PostPrepare_smgr(void)
Definition: storage.c:911
SMgrRelation RelationCreateStorage(RelFileLocator rlocator, char relpersistence, bool register_delete)
Definition: storage.c:120
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:718
void smgrDoPendingDeletes(bool isCommit)
Definition: storage.c:650