PostgreSQL Source Code  git master
bulk_write.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * bulk_write.h
4  * Efficiently and reliably populate a new relation
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/storage/bulk_write.h
11  *
12  *-------------------------------------------------------------------------
13  */
14 #ifndef BULK_WRITE_H
15 #define BULK_WRITE_H
16 
17 #include "storage/smgr.h"
18 #include "utils/rel.h"
19 
20 /* Bulk writer state, contents are private to bulk_write.c */
21 typedef struct BulkWriteState BulkWriteState;
22 
23 /*
24  * Temporary buffer to hold a page to until it's written out. Use
25  * smgr_bulk_get_buf() to reserve one of these. This is a separate typedef to
26  * distinguish it from other block-sized buffers passed around in the system.
27  */
29 
30 /* forward declared from smgr.h */
31 struct SMgrRelationData;
32 
34 extern BulkWriteState *smgr_bulk_start_smgr(struct SMgrRelationData *smgr, ForkNumber forknum, bool use_wal);
35 
37 extern void smgr_bulk_write(BulkWriteState *bulkstate, BlockNumber blocknum, BulkWriteBuffer buf, bool page_std);
38 
39 extern void smgr_bulk_finish(BulkWriteState *bulkstate);
40 
41 #endif /* BULK_WRITE_H */
uint32 BlockNumber
Definition: block.h:31
void smgr_bulk_write(BulkWriteState *bulkstate, BlockNumber blocknum, BulkWriteBuffer buf, bool page_std)
Definition: bulk_write.c:271
BulkWriteBuffer smgr_bulk_get_buf(BulkWriteState *bulkstate)
Definition: bulk_write.c:295
void smgr_bulk_finish(BulkWriteState *bulkstate)
Definition: bulk_write.c:129
PGIOAlignedBlock * BulkWriteBuffer
Definition: bulk_write.h:28
BulkWriteState * smgr_bulk_start_smgr(struct SMgrRelationData *smgr, ForkNumber forknum, bool use_wal)
BulkWriteState * smgr_bulk_start_rel(Relation rel, ForkNumber forknum)
Definition: bulk_write.c:86
static char * buf
Definition: pg_test_fsync.c:73
ForkNumber
Definition: relpath.h:48