mirror of
https://github.com/postgres/postgres.git
synced 2026-01-27 21:43:08 +03:00
There are a number of forward declarations that use struct but not the customary typedef, because that could have led to repeat typedefs, which was not allowed. This is now allowed in C11, so we can update these to provide the typedefs as well, so that the later uses of the types look more consistent. Reviewed-by: Chao Li <li.evan.chao@gmail.com> Discussion: https://www.postgresql.org/message-id/flat/10d32190-f31b-40a5-b177-11db55597355@eisentraut.org
42 lines
1.4 KiB
C
42 lines
1.4 KiB
C
/*-------------------------------------------------------------------------
|
|
*
|
|
* bulk_write.h
|
|
* Efficiently and reliably populate a new relation
|
|
*
|
|
*
|
|
* Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group
|
|
* Portions Copyright (c) 1994, Regents of the University of California
|
|
*
|
|
* src/include/storage/bulk_write.h
|
|
*
|
|
*-------------------------------------------------------------------------
|
|
*/
|
|
#ifndef BULK_WRITE_H
|
|
#define BULK_WRITE_H
|
|
|
|
#include "storage/smgr.h"
|
|
#include "utils/rel.h"
|
|
|
|
/* Bulk writer state, contents are private to bulk_write.c */
|
|
typedef struct BulkWriteState BulkWriteState;
|
|
|
|
/*
|
|
* Temporary buffer to hold a page to until it's written out. Use
|
|
* smgr_bulk_get_buf() to reserve one of these. This is a separate typedef to
|
|
* distinguish it from other block-sized buffers passed around in the system.
|
|
*/
|
|
typedef PGIOAlignedBlock *BulkWriteBuffer;
|
|
|
|
/* forward declared from smgr.h */
|
|
typedef struct SMgrRelationData *SMgrRelation;
|
|
|
|
extern BulkWriteState *smgr_bulk_start_rel(Relation rel, ForkNumber forknum);
|
|
extern BulkWriteState *smgr_bulk_start_smgr(SMgrRelation smgr, ForkNumber forknum, bool use_wal);
|
|
|
|
extern BulkWriteBuffer smgr_bulk_get_buf(BulkWriteState *bulkstate);
|
|
extern void smgr_bulk_write(BulkWriteState *bulkstate, BlockNumber blocknum, BulkWriteBuffer buf, bool page_std);
|
|
|
|
extern void smgr_bulk_finish(BulkWriteState *bulkstate);
|
|
|
|
#endif /* BULK_WRITE_H */
|