PostgreSQL Source Code git master
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"
18
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 */
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;
41
42extern void logicalrep_relmap_update(LogicalRepRelation *remoterel);
44
46 LOCKMODE lockmode);
48 Relation partrel, AttrMap *map);
50 LOCKMODE lockmode);
51extern bool IsIndexUsableForReplicaIdentityFull(Relation idxrel, AttrMap *attrmap);
53
54#endif /* LOGICALRELATION_H */
int LOCKMODE
Definition: lockdefs.h:26
uint32 LogicalRepRelId
Definition: logicalproto.h:101
void logicalrep_partmap_reset_relmap(LogicalRepRelation *remoterel)
Definition: relation.c:570
LogicalRepRelMapEntry * logicalrep_partition_open(LogicalRepRelMapEntry *root, Relation partrel, AttrMap *map)
Definition: relation.c:632
struct LogicalRepRelMapEntry LogicalRepRelMapEntry
bool IsIndexUsableForReplicaIdentityFull(Relation idxrel, AttrMap *attrmap)
Definition: relation.c:820
Oid GetRelationIdentityOrPK(Relation rel)
Definition: relation.c:887
void logicalrep_relmap_update(LogicalRepRelation *remoterel)
Definition: relation.c:163
void logicalrep_rel_close(LogicalRepRelMapEntry *rel, LOCKMODE lockmode)
Definition: relation.c:503
LogicalRepRelMapEntry * logicalrep_rel_open(LogicalRepRelId remoteid, LOCKMODE lockmode)
Definition: relation.c:348
unsigned int Oid
Definition: postgres_ext.h:31
tree ctl root
Definition: radixtree.h:1857
Definition: attmap.h:35
LogicalRepRelation remoterel
uint64 XLogRecPtr
Definition: xlogdefs.h:21