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-2020, 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"
17 
18 typedef struct LogicalRepRelMapEntry
19 {
20  LogicalRepRelation remoterel; /* key is remoterel.remoteid */
21 
22  /* Mapping to local relation, filled as needed. */
23  Oid localreloid; /* local relation id */
24  Relation localrel; /* relcache entry */
25  AttrMap *attrmap; /* map of local attributes to remote ones */
26  bool updatable; /* Can apply updates/deletes? */
27 
28  /* Sync state. */
29  char state;
32 
34 
36  LOCKMODE lockmode);
38  Relation partrel, AttrMap *map);
40  LOCKMODE lockmode);
41 
42 extern void logicalrep_typmap_update(LogicalRepTyp *remotetyp);
43 extern char *logicalrep_typmap_gettypname(Oid remoteid);
44 
45 #endif /* LOGICALRELATION_H */
int LOCKMODE
Definition: lockdefs.h:26
void logicalrep_typmap_update(LogicalRepTyp *remotetyp)
Definition: relation.c:419
unsigned int Oid
Definition: postgres_ext.h:31
void logicalrep_rel_close(LogicalRepRelMapEntry *rel, LOCKMODE lockmode)
Definition: relation.c:399
char * logicalrep_typmap_gettypname(Oid remoteid)
Definition: relation.c:453
Definition: attmap.h:34
LogicalRepRelation remoterel
LogicalRepRelMapEntry * logicalrep_partition_open(LogicalRepRelMapEntry *root, Relation partrel, AttrMap *map)
Definition: relation.c:582
LogicalRepRelMapEntry * logicalrep_rel_open(LogicalRepRelId remoteid, LOCKMODE lockmode)
Definition: relation.c:237
struct LogicalRepRelMapEntry LogicalRepRelMapEntry
uint64 XLogRecPtr
Definition: xlogdefs.h:21
void logicalrep_relmap_update(LogicalRepRelation *remoterel)
Definition: relation.c:172
uint32 LogicalRepRelId
Definition: logicalproto.h:39