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-2017, PostgreSQL Global Development Group
7  *
8  * src/include/replication/logicalrelation.h
9  *
10  *-------------------------------------------------------------------------
11  */
12 #ifndef LOGICALRELATION_H
13 #define LOGICALRELATION_H
14 
16 
17 typedef struct LogicalRepRelMapEntry
18 {
19  LogicalRepRelation remoterel; /* key is remoterel.remoteid */
20 
21  /* Mapping to local relation, filled as needed. */
22  Oid localreloid; /* local relation id */
23  Relation localrel; /* relcache entry */
24  AttrNumber *attrmap; /* map of local attributes to remote ones */
25  bool updatable; /* Can apply updates/deletes? */
26 
27  /* Sync state. */
28  char state;
31 
33 
35  LOCKMODE lockmode);
37  LOCKMODE lockmode);
38 
39 extern void logicalrep_typmap_update(LogicalRepTyp *remotetyp);
40 extern Oid logicalrep_typmap_getid(Oid remoteid);
41 
42 #endif /* LOGICALRELATION_H */
int LOCKMODE
Definition: lockdefs.h:26
void logicalrep_typmap_update(LogicalRepTyp *remotetyp)
Definition: relation.c:415
unsigned int Oid
Definition: postgres_ext.h:31
void logicalrep_rel_close(LogicalRepRelMapEntry *rel, LOCKMODE lockmode)
Definition: relation.c:372
LogicalRepRelation remoterel
LogicalRepRelMapEntry * logicalrep_rel_open(LogicalRepRelId remoteid, LOCKMODE lockmode)
Definition: relation.c:223
struct LogicalRepRelMapEntry LogicalRepRelMapEntry
uint64 XLogRecPtr
Definition: xlogdefs.h:21
Oid logicalrep_typmap_getid(Oid remoteid)
Definition: relation.c:446
void logicalrep_relmap_update(LogicalRepRelation *remoterel)
Definition: relation.c:158
int16 AttrNumber
Definition: attnum.h:21
uint32 LogicalRepRelId
Definition: logicalproto.h:39