PostgreSQL Source Code  git master
hio.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * hio.h
4  * POSTGRES heap access method input/output definitions.
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/access/hio.h
11  *
12  *-------------------------------------------------------------------------
13  */
14 #ifndef HIO_H
15 #define HIO_H
16 
17 #include "access/htup.h"
18 #include "storage/buf.h"
19 #include "utils/relcache.h"
20 
21 /*
22  * state for bulk inserts --- private to heapam.c and hio.c
23  *
24  * If current_buf isn't InvalidBuffer, then we are holding an extra pin
25  * on that buffer.
26  *
27  * "typedef struct BulkInsertStateData *BulkInsertState" is in heapam.h
28  */
29 typedef struct BulkInsertStateData
30 {
31  BufferAccessStrategy strategy; /* our BULKWRITE strategy object */
32  Buffer current_buf; /* current insertion target page */
33 
34  /*
35  * State for bulk extensions. Further pages that were unused at the time
36  * of the extension. They might be in use by the time we use them though,
37  * so rechecks are needed.
38  *
39  * XXX: Eventually these should probably live in RelationData instead,
40  * alongside targetblock.
41  */
45 
46 
47 extern void RelationPutHeapTuple(Relation relation, Buffer buffer,
48  HeapTuple tuple, bool token);
50  Buffer otherBuffer, int options,
51  BulkInsertStateData *bistate,
52  Buffer *vmbuffer, Buffer *vmbuffer_other,
53  int num_pages);
54 
55 #endif /* HIO_H */
uint32 BlockNumber
Definition: block.h:31
int Buffer
Definition: buf.h:23
size_t Size
Definition: c.h:589
Buffer RelationGetBufferForTuple(Relation relation, Size len, Buffer otherBuffer, int options, BulkInsertStateData *bistate, Buffer *vmbuffer, Buffer *vmbuffer_other, int num_pages)
void RelationPutHeapTuple(Relation relation, Buffer buffer, HeapTuple tuple, bool token)
Definition: hio.c:36
struct BulkInsertStateData BulkInsertStateData
#define token
Definition: indent_globs.h:126
const void size_t len
BlockNumber last_free
Definition: hio.h:43
BufferAccessStrategy strategy
Definition: hio.h:31
BlockNumber next_free
Definition: hio.h:42
Buffer current_buf
Definition: hio.h:32