PostgreSQL Source Code
git master
logicalrelation.h
Go to the documentation of this file.
1
/*-------------------------------------------------------------------------
2
*
3
* logicalrelation.h
4
* Relation definitions for logical replication relation mapping.
5
*
6
* Portions Copyright (c) 2016-2024, PostgreSQL Global Development Group
7
*
8
* src/include/replication/logicalrelation.h
9
*
10
*-------------------------------------------------------------------------
11
*/
12
#ifndef LOGICALRELATION_H
13
#define LOGICALRELATION_H
14
15
#include "
access/attmap.h
"
16
#include "
catalog/index.h
"
17
#include "
replication/logicalproto.h
"
18
19
typedef
struct
LogicalRepRelMapEntry
20
{
21
LogicalRepRelation
remoterel
;
/* key is remoterel.remoteid */
22
23
/*
24
* Validity flag -- when false, revalidate all derived info at next
25
* logicalrep_rel_open. (While the localrel is open, we assume our lock
26
* on that rel ensures the info remains good.)
27
*/
28
bool
localrelvalid
;
29
30
/* Mapping to local relation. */
31
Oid
localreloid
;
/* local relation id */
32
Relation
localrel
;
/* relcache entry (NULL when closed) */
33
AttrMap
*
attrmap
;
/* map of local attributes to remote ones */
34
bool
updatable
;
/* Can apply updates/deletes? */
35
Oid
localindexoid
;
/* which index to use, or InvalidOid if none */
36
37
/* Sync state. */
38
char
state
;
39
XLogRecPtr
statelsn
;
40
}
LogicalRepRelMapEntry
;
41
42
extern
void
logicalrep_relmap_update
(
LogicalRepRelation
*remoterel);
43
extern
void
logicalrep_partmap_reset_relmap
(
LogicalRepRelation
*remoterel);
44
45
extern
LogicalRepRelMapEntry
*
logicalrep_rel_open
(
LogicalRepRelId
remoteid,
46
LOCKMODE
lockmode);
47
extern
LogicalRepRelMapEntry
*
logicalrep_partition_open
(
LogicalRepRelMapEntry
*
root
,
48
Relation
partrel,
AttrMap
*map);
49
extern
void
logicalrep_rel_close
(
LogicalRepRelMapEntry
*rel,
50
LOCKMODE
lockmode);
51
extern
bool
IsIndexUsableForReplicaIdentityFull
(
IndexInfo
*indexInfo,
AttrMap
*attrmap);
52
extern
Oid
GetRelationIdentityOrPK
(
Relation
rel);
53
54
#endif
/* LOGICALRELATION_H */
attmap.h
index.h
LOCKMODE
int LOCKMODE
Definition:
lockdefs.h:26
logicalproto.h
LogicalRepRelId
uint32 LogicalRepRelId
Definition:
logicalproto.h:101
logicalrep_partmap_reset_relmap
void logicalrep_partmap_reset_relmap(LogicalRepRelation *remoterel)
Definition:
relation.c:540
IsIndexUsableForReplicaIdentityFull
bool IsIndexUsableForReplicaIdentityFull(IndexInfo *indexInfo, AttrMap *attrmap)
Definition:
relation.c:804
logicalrep_partition_open
LogicalRepRelMapEntry * logicalrep_partition_open(LogicalRepRelMapEntry *root, Relation partrel, AttrMap *map)
Definition:
relation.c:602
LogicalRepRelMapEntry
struct LogicalRepRelMapEntry LogicalRepRelMapEntry
GetRelationIdentityOrPK
Oid GetRelationIdentityOrPK(Relation rel)
Definition:
relation.c:851
logicalrep_relmap_update
void logicalrep_relmap_update(LogicalRepRelation *remoterel)
Definition:
relation.c:164
logicalrep_rel_open
LogicalRepRelMapEntry * logicalrep_rel_open(LogicalRepRelId remoteid, LOCKMODE lockmode)
Definition:
relation.c:327
logicalrep_rel_close
void logicalrep_rel_close(LogicalRepRelMapEntry *rel, LOCKMODE lockmode)
Definition:
relation.c:473
Oid
unsigned int Oid
Definition:
postgres_ext.h:31
root
tree ctl root
Definition:
radixtree.h:1886
AttrMap
Definition:
attmap.h:35
IndexInfo
Definition:
execnodes.h:184
LogicalRepRelMapEntry
Definition:
logicalrelation.h:20
LogicalRepRelMapEntry::localrel
Relation localrel
Definition:
logicalrelation.h:32
LogicalRepRelMapEntry::remoterel
LogicalRepRelation remoterel
Definition:
logicalrelation.h:21
LogicalRepRelMapEntry::localindexoid
Oid localindexoid
Definition:
logicalrelation.h:35
LogicalRepRelMapEntry::localrelvalid
bool localrelvalid
Definition:
logicalrelation.h:28
LogicalRepRelMapEntry::updatable
bool updatable
Definition:
logicalrelation.h:34
LogicalRepRelMapEntry::state
char state
Definition:
logicalrelation.h:38
LogicalRepRelMapEntry::attrmap
AttrMap * attrmap
Definition:
logicalrelation.h:33
LogicalRepRelMapEntry::localreloid
Oid localreloid
Definition:
logicalrelation.h:31
LogicalRepRelMapEntry::statelsn
XLogRecPtr statelsn
Definition:
logicalrelation.h:39
LogicalRepRelation
Definition:
logicalproto.h:105
RelationData
Definition:
rel.h:56
XLogRecPtr
uint64 XLogRecPtr
Definition:
xlogdefs.h:21
src
include
replication
logicalrelation.h
Generated on Fri Oct 11 2024 12:13:25 for PostgreSQL Source Code by
1.9.1