PostgreSQL Source Code: src/include/storage/bulk_write.h Source File

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-2025, 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 */
28 typedef PGIOAlignedBlock *BulkWriteBuffer;
29
30/* forward declared from smgr.h */
31 typedef struct SMgrRelationData *SMgrRelation;
32
33extern BulkWriteState *smgr_bulk_start_rel(Relation rel, ForkNumber forknum);
34extern BulkWriteState *smgr_bulk_start_smgr(SMgrRelation smgr, ForkNumber forknum, bool use_wal);
35
36extern BulkWriteBuffer smgr_bulk_get_buf(BulkWriteState *bulkstate);
37extern void smgr_bulk_write(BulkWriteState *bulkstate, BlockNumber blocknum, BulkWriteBuffer buf, bool page_std);
38
39extern void smgr_bulk_finish(BulkWriteState *bulkstate);
40
41#endif /* BULK_WRITE_H */
uint32 BlockNumber
Definition: block.h:31
struct SMgrRelationData * SMgrRelation
Definition: bulk_write.h:31
BulkWriteState * smgr_bulk_start_rel(Relation rel, ForkNumber forknum)
Definition: bulk_write.c:87
void smgr_bulk_write(BulkWriteState *bulkstate, BlockNumber blocknum, BulkWriteBuffer buf, bool page_std)
Definition: bulk_write.c:323
BulkWriteBuffer smgr_bulk_get_buf(BulkWriteState *bulkstate)
Definition: bulk_write.c:347
BulkWriteState * smgr_bulk_start_smgr(SMgrRelation smgr, ForkNumber forknum, bool use_wal)
Definition: bulk_write.c:100
void smgr_bulk_finish(BulkWriteState *bulkstate)
Definition: bulk_write.c:130
PGIOAlignedBlock * BulkWriteBuffer
Definition: bulk_write.h:28
static char * buf
Definition: pg_test_fsync.c:72
ForkNumber
Definition: relpath.h:56
Definition: rel.h:56

AltStyle によって変換されたページ (->オリジナル) /