PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
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-2017, 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/relfilenode.h"
19 #include "utils/relcache.h"
20 
21 /* struct definition is private to rewriteheap.c */
23 
24 extern RewriteState begin_heap_rewrite(Relation OldHeap, Relation NewHeap,
26  MultiXactId MultiXactCutoff, bool use_wal);
27 extern void end_heap_rewrite(RewriteState state);
28 extern void rewrite_heap_tuple(RewriteState state, HeapTuple oldTuple,
29  HeapTuple newTuple);
30 extern bool rewrite_heap_dead_tuple(RewriteState state, HeapTuple oldTuple);
31 
32 /*
33  * On-Disk data format for an individual logical rewrite mapping.
34  */
36 {
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) xid we are mapping for
49  * 4) upper 32bit of the LSN at which a rewrite started
50  * 5) lower 32bit of the LSN at which a rewrite started
51  * 6) xid of the xact performing the mapping
52  * ---
53  */
54 #define LOGICAL_REWRITE_FORMAT "map-%x-%x-%X_%X-%x-%x"
56 
57 #endif /* REWRITE_HEAP_H */
uint32 TransactionId
Definition: c.h:397
void end_heap_rewrite(RewriteState state)
Definition: rewriteheap.c:314
bool rewrite_heap_dead_tuple(RewriteState state, HeapTuple oldTuple)
Definition: rewriteheap.c:578
static MultiXactId MultiXactCutoff
Definition: vacuumlazy.c:140
static TransactionId OldestXmin
Definition: vacuumlazy.c:138
RewriteState begin_heap_rewrite(Relation OldHeap, Relation NewHeap, TransactionId OldestXmin, TransactionId FreezeXid, MultiXactId MultiXactCutoff, bool use_wal)
Definition: rewriteheap.c:248
TransactionId MultiXactId
Definition: c.h:407
ItemPointerData new_tid
Definition: rewriteheap.h:40
Definition: regguts.h:298
void CheckPointLogicalRewriteHeap(void)
Definition: rewriteheap.c:1200
struct RewriteStateData * RewriteState
Definition: rewriteheap.h:22
struct LogicalRewriteMappingData LogicalRewriteMappingData
void rewrite_heap_tuple(RewriteState state, HeapTuple oldTuple, HeapTuple newTuple)
Definition: rewriteheap.c:380
ItemPointerData old_tid
Definition: rewriteheap.h:39