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-2024, 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:1319
size_t Size
Definition: c.h:608
ForkNumber
Definition: relpath.h:56
void RelationPreserveStorage(RelFileLocator rlocator, bool atCommit)
Definition: storage.c:251
void RelationPreTruncate(Relation rel)
Definition: storage.c:424
void SerializePendingSyncs(Size maxSize, char *startAddress)
Definition: storage.c:559
void AtSubCommit_smgr(void)
Definition: storage.c:914
Size EstimatePendingSyncsSpace(void)
Definition: storage.c:546
void AtSubAbort_smgr(void)
Definition: storage.c:934
void RelationCopyStorage(SMgrRelation src, SMgrRelation dst, ForkNumber forkNum, char relpersistence)
Definition: storage.c:452
bool RelFileLocatorSkippingWAL(RelFileLocator rlocator)
Definition: storage.c:532
int smgrGetPendingDeletes(bool forCommit, RelFileLocator **ptr)
Definition: storage.c:852
void PostPrepare_smgr(void)
Definition: storage.c:893
SMgrRelation RelationCreateStorage(RelFileLocator rlocator, char relpersistence, bool register_delete)
Definition: storage.c:121
void RestorePendingSyncs(char *startAddress)
Definition: storage.c:610
void RelationDropStorage(Relation rel)
Definition: storage.c:206
void RelationTruncate(Relation rel, BlockNumber nblocks)
Definition: storage.c:288
PGDLLIMPORT int wal_skip_threshold
Definition: storage.c:39
void smgrDoPendingSyncs(bool isCommit, bool isParallelWorker)
Definition: storage.c:700
void smgrDoPendingDeletes(bool isCommit)
Definition: storage.c:632