PostgreSQL Source Code
git master
Toggle main menu visibility
Main Page
Related Pages
Namespaces
Namespace List
Namespace Members
All
Functions
Variables
Data Structures
Data Structures
Data Structure Index
Class Hierarchy
Data Fields
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
f
h
i
n
o
p
r
s
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
Files
File List
Globals
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Enumerator
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Macros
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
•
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Pages
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-2025, 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
(
Relation
idxrel,
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:570
logicalrep_partition_open
LogicalRepRelMapEntry * logicalrep_partition_open(LogicalRepRelMapEntry *root, Relation partrel, AttrMap *map)
Definition:
relation.c:632
LogicalRepRelMapEntry
struct LogicalRepRelMapEntry LogicalRepRelMapEntry
IsIndexUsableForReplicaIdentityFull
bool IsIndexUsableForReplicaIdentityFull(Relation idxrel, AttrMap *attrmap)
Definition:
relation.c:820
GetRelationIdentityOrPK
Oid GetRelationIdentityOrPK(Relation rel)
Definition:
relation.c:887
logicalrep_relmap_update
void logicalrep_relmap_update(LogicalRepRelation *remoterel)
Definition:
relation.c:163
logicalrep_rel_close
void logicalrep_rel_close(LogicalRepRelMapEntry *rel, LOCKMODE lockmode)
Definition:
relation.c:503
logicalrep_rel_open
LogicalRepRelMapEntry * logicalrep_rel_open(LogicalRepRelId remoteid, LOCKMODE lockmode)
Definition:
relation.c:348
Oid
unsigned int Oid
Definition:
postgres_ext.h:31
root
tree ctl root
Definition:
radixtree.h:1857
AttrMap
Definition:
attmap.h:35
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 Wed Jan 8 2025 06:13:24 for PostgreSQL Source Code by
1.9.4