PostgreSQL Source Code
git master
Loading...
Searching...
No Matches
rewriteheap.h
Go to the documentation of this file.
1
/*-------------------------------------------------------------------------
2
*
3
* rewriteheap.h
4
* Declarations for heap rewrite support functions
5
*
6
* Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group
7
* Portions Copyright (c) 1994-5, Regents of the University of California
8
*
9
* src/include/access/rewriteheap.h
10
*
11
*-------------------------------------------------------------------------
12
*/
13
#ifndef REWRITE_HEAP_H
14
#define REWRITE_HEAP_H
15
16
#include "
access/htup.h
"
17
#include "
storage/itemptr.h
"
18
#include "
storage/relfilelocator.h
"
19
#include "
utils/relcache.h
"
20
21
/* struct definition is private to rewriteheap.c */
22
typedef
struct
RewriteStateData
*
RewriteState
;
23
24
extern
RewriteState
begin_heap_rewrite
(
Relation
old_heap
,
Relation
new_heap
,
25
TransactionId
oldest_xmin
,
TransactionId
freeze_xid
,
26
MultiXactId
cutoff_multi
);
27
extern
void
end_heap_rewrite
(
RewriteState
state
);
28
extern
void
rewrite_heap_tuple
(
RewriteState
state
,
HeapTuple
old_tuple
,
29
HeapTuple
new_tuple
);
30
extern
bool
rewrite_heap_dead_tuple
(
RewriteState
state
,
HeapTuple
old_tuple
);
31
32
/*
33
* On-Disk data format for an individual logical rewrite mapping.
34
*/
35
typedef
struct
LogicalRewriteMappingData
36
{
37
RelFileLocator
old_locator
;
38
RelFileLocator
new_locator
;
39
ItemPointerData
old_tid
;
40
ItemPointerData
new_tid
;
41
}
LogicalRewriteMappingData
;
42
43
/* ---
44
* The filename consists of the following, dash separated,
45
* components:
46
* 1) database oid or InvalidOid for shared relations
47
* 2) the oid of the relation
48
* 3) upper 32bit of the LSN at which a rewrite started
49
* 4) lower 32bit of the LSN at which a rewrite started
50
* 5) xid we are mapping for
51
* 6) xid of the xact performing the mapping
52
* ---
53
*/
54
#define LOGICAL_REWRITE_FORMAT "map-%x-%x-%X_%X-%x-%x"
55
extern
void
CheckPointLogicalRewriteHeap
(
void
);
56
57
#endif
/* REWRITE_HEAP_H */
MultiXactId
TransactionId MultiXactId
Definition
c.h:676
TransactionId
uint32 TransactionId
Definition
c.h:666
htup.h
itemptr.h
fb
static int fb(int x)
Definition
preproc-init.c:92
relcache.h
relfilelocator.h
RewriteState
struct RewriteStateData * RewriteState
Definition
rewriteheap.h:22
end_heap_rewrite
void end_heap_rewrite(RewriteState state)
Definition
rewriteheap.c:297
rewrite_heap_dead_tuple
bool rewrite_heap_dead_tuple(RewriteState state, HeapTuple old_tuple)
Definition
rewriteheap.c:546
begin_heap_rewrite
RewriteState begin_heap_rewrite(Relation old_heap, Relation new_heap, TransactionId oldest_xmin, TransactionId freeze_xid, MultiXactId cutoff_multi)
Definition
rewriteheap.c:234
CheckPointLogicalRewriteHeap
void CheckPointLogicalRewriteHeap(void)
Definition
rewriteheap.c:1157
rewrite_heap_tuple
void rewrite_heap_tuple(RewriteState state, HeapTuple old_tuple, HeapTuple new_tuple)
Definition
rewriteheap.c:341
HeapTupleData
Definition
htup.h:63
ItemPointerData
Definition
itemptr.h:37
LogicalRewriteMappingData
Definition
rewriteheap.h:36
LogicalRewriteMappingData::new_tid
ItemPointerData new_tid
Definition
rewriteheap.h:40
LogicalRewriteMappingData::old_locator
RelFileLocator old_locator
Definition
rewriteheap.h:37
LogicalRewriteMappingData::old_tid
ItemPointerData old_tid
Definition
rewriteheap.h:39
LogicalRewriteMappingData::new_locator
RelFileLocator new_locator
Definition
rewriteheap.h:38
RelFileLocator
Definition
relfilelocator.h:59
RelationData
Definition
rel.h:56
RewriteStateData
Definition
rewriteheap.c:131
state
Definition
regguts.h:323
src
include
access
rewriteheap.h
Generated on Sun Feb 1 2026 00:13:16 for PostgreSQL Source Code by
1.9.8