1 /*-------------------------------------------------------------------------
4 * Declarations for heap rewrite support functions
6 * Portions Copyright (c) 1996-2021, PostgreSQL Global Development Group
7 * Portions Copyright (c) 1994-5, Regents of the University of California
9 * src/include/access/rewriteheap.h
11 *-------------------------------------------------------------------------
13 #ifndef REWRITE_HEAP_H
14 #define REWRITE_HEAP_H
16 #include "access/htup.h"
17 #include "storage/itemptr.h"
18 #include "storage/relfilenode.h"
19 #include "utils/relcache.h"
21 /* struct definition is private to rewriteheap.c */
22 typedef struct RewriteStateData
*RewriteState
;
24 extern RewriteState
begin_heap_rewrite(Relation OldHeap
, Relation NewHeap
,
25 TransactionId OldestXmin
, TransactionId FreezeXid
,
26 MultiXactId MultiXactCutoff
);
27 extern void end_heap_rewrite(RewriteState state
);
28 extern void rewrite_heap_tuple(RewriteState state
, HeapTuple oldTuple
,
30 extern bool rewrite_heap_dead_tuple(RewriteState state
, HeapTuple oldTuple
);
33 * On-Disk data format for an individual logical rewrite mapping.
35 typedef struct LogicalRewriteMappingData
39 ItemPointerData old_tid
;
40 ItemPointerData new_tid
;
41 } LogicalRewriteMappingData
;
44 * The filename consists of the following, dash separated,
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
54 #define LOGICAL_REWRITE_FORMAT "map-%x-%x-%X_%X-%x-%x"
55 void CheckPointLogicalRewriteHeap(void);
57 #endif /* REWRITE_HEAP_H */