PostgreSQL Source Code
git master
|
#include "postgres.h"
#include "access/genam.h"
#include "access/table.h"
#include "catalog/namespace.h"
#include "catalog/pg_subscription_rel.h"
#include "executor/executor.h"
#include "nodes/makefuncs.h"
#include "replication/logicalrelation.h"
#include "replication/worker_internal.h"
#include "utils/inval.h"
Go to the source code of this file.
Data Structures | |
struct | LogicalRepPartMapEntry |
Typedefs | |
typedef struct LogicalRepPartMapEntry | LogicalRepPartMapEntry |
Variables | |
static MemoryContext | LogicalRepRelMapContext = NULL |
static HTAB * | LogicalRepRelMap = NULL |
static MemoryContext | LogicalRepPartMapContext = NULL |
static HTAB * | LogicalRepPartMap = NULL |
typedef struct LogicalRepPartMapEntry LogicalRepPartMapEntry |
|
static |
Definition at line 868 of file relation.c.
References FindUsableIndexForReplicaIdentityFull(), GetRelationIdentityOrPK(), InvalidOid, OidIsValid, RelationData::rd_rel, and LogicalRepRelation::replident.
Referenced by logicalrep_partition_open(), and logicalrep_rel_open().
Definition at line 745 of file relation.c.
References AccessShareLock, BuildIndexInfo(), foreach_oid, index_close(), index_open(), InvalidOid, IsIndexUsableForReplicaIdentityFull(), and RelationGetIndexList().
Referenced by FindLogicalRepLocalIndex().
Definition at line 851 of file relation.c.
References OidIsValid, RelationGetPrimaryKeyIndex(), and RelationGetReplicaIndex().
Referenced by build_tuple_value_details(), check_relation_updatable(), FindLogicalRepLocalIndex(), FindReplTupleInLocalRel(), and RelationFindReplTupleByIndex().
Definition at line 804 of file relation.c.
References IndexAmRoutine::amgettuple, Assert, AttrMap::attnums, AttributeNumberIsValid, AttrNumberGetAttrOffset, get_equal_strategy_number_for_am(), GetIndexAmRoutineByAmId(), IndexInfo::ii_Am, IndexInfo::ii_IndexAttrNumbers, IndexInfo::ii_NumIndexAttrs, IndexInfo::ii_Predicate, InvalidStrategy, AttrMap::maplen, and NIL.
Referenced by FindReplTupleInLocalRel(), and FindUsableIndexForReplicaIdentityFull().
LogicalRepRelMapEntry* logicalrep_partition_open | ( | LogicalRepRelMapEntry * | root, |
Relation | partrel, | ||
AttrMap * | map | ||
) |
Definition at line 602 of file relation.c.
References LogicalRepRelation::attkeys, LogicalRepRelation::attnames, AttrMap::attnums, LogicalRepRelMapEntry::attrmap, LogicalRepRelation::atttyps, bms_copy(), FindLogicalRepLocalIndex(), free_attrmap(), HASH_ENTER, hash_search(), i, LogicalRepRelMapEntry::localindexoid, LogicalRepRelMapEntry::localrel, LogicalRepRelMapEntry::localreloid, LogicalRepRelMapEntry::localrelvalid, logicalrep_partmap_init(), logicalrep_rel_mark_updatable(), LogicalRepPartMap, LogicalRepPartMapContext, make_attrmap(), AttrMap::maplen, MemoryContextSwitchTo(), LogicalRepRelation::natts, LogicalRepRelation::nspname, palloc(), LogicalRepPartMapEntry::partoid, pstrdup(), RelationGetRelid, LogicalRepPartMapEntry::relmapentry, LogicalRepRelation::relname, LogicalRepRelation::remoteid, LogicalRepRelMapEntry::remoterel, LogicalRepRelation::replident, and root.
Referenced by apply_handle_tuple_routing().
|
static |
Definition at line 567 of file relation.c.
References ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate, CacheMemoryContext, CacheRegisterRelcacheCallback(), ctl, HASH_BLOBS, HASH_CONTEXT, hash_create(), HASH_ELEM, logicalrep_partmap_invalidate_cb(), LogicalRepPartMap, and LogicalRepPartMapContext.
Referenced by logicalrep_partition_open().
Definition at line 492 of file relation.c.
References hash_seq_init(), hash_seq_search(), hash_seq_term(), InvalidOid, LogicalRepRelMapEntry::localreloid, LogicalRepRelMapEntry::localrelvalid, LogicalRepPartMap, and LogicalRepPartMapEntry::relmapentry.
Referenced by logicalrep_partmap_init().
void logicalrep_partmap_reset_relmap | ( | LogicalRepRelation * | remoterel | ) |
Definition at line 540 of file relation.c.
References hash_seq_init(), hash_seq_search(), logicalrep_relmap_free_entry(), LogicalRepPartMap, LogicalRepPartMapEntry::relmapentry, LogicalRepRelation::remoteid, and LogicalRepRelMapEntry::remoterel.
Referenced by apply_handle_relation().
|
static |
Definition at line 209 of file relation.c.
References attname, LogicalRepRelation::attnames, i, and LogicalRepRelation::natts.
Referenced by logicalrep_rel_open().
void logicalrep_rel_close | ( | LogicalRepRelMapEntry * | rel, |
LOCKMODE | lockmode | ||
) |
Definition at line 473 of file relation.c.
References LogicalRepRelMapEntry::localrel, and table_close().
Referenced by apply_handle_delete(), apply_handle_insert(), apply_handle_truncate(), apply_handle_update(), and copy_table().
|
static |
Definition at line 274 of file relation.c.
References LogicalRepRelation::attkeys, attnum, AttrMap::attnums, LogicalRepRelMapEntry::attrmap, AttrNumberGetAttrOffset, AttrNumberIsForUserDefinedAttr, bms_is_member(), bms_next_member(), ereport, errcode(), errmsg(), ERROR, FirstLowInvalidHeapAttributeNumber, i, INDEX_ATTR_BITMAP_IDENTITY_KEY, INDEX_ATTR_BITMAP_PRIMARY_KEY, LogicalRepRelMapEntry::localrel, LogicalRepRelation::nspname, RelationGetIndexAttrBitmap(), LogicalRepRelation::relname, LogicalRepRelMapEntry::remoterel, LogicalRepRelation::replident, and LogicalRepRelMapEntry::updatable.
Referenced by logicalrep_partition_open(), and logicalrep_rel_open().
LogicalRepRelMapEntry* logicalrep_rel_open | ( | LogicalRepRelId | remoteid, |
LOCKMODE | lockmode | ||
) |
Definition at line 327 of file relation.c.
References attnum, AttrMap::attnums, LogicalRepRelMapEntry::attrmap, bms_add_range(), bms_del_member(), bms_free(), CheckSubscriptionRelkind(), elog, ereport, errcode(), errmsg(), ERROR, FindLogicalRepLocalIndex(), free_attrmap(), GetSubscriptionRelState(), HASH_FIND, hash_search(), i, LogicalRepRelMapEntry::localindexoid, LogicalRepRelMapEntry::localrel, LogicalRepRelMapEntry::localreloid, LogicalRepRelMapEntry::localrelvalid, logicalrep_rel_att_by_name(), logicalrep_rel_mark_updatable(), logicalrep_relmap_init(), logicalrep_report_missing_attrs(), LogicalRepRelMap, LogicalRepRelMapContext, make_attrmap(), makeRangeVar(), MemoryContextSwitchTo(), MySubscription, NameStr, TupleDescData::natts, LogicalRepRelation::natts, NoLock, LogicalRepRelation::nspname, Subscription::oid, OidIsValid, RangeVarGetRelid, RelationData::rd_rel, RelationGetDescr, LogicalRepRelation::relname, LogicalRepRelMapEntry::remoterel, LogicalRepRelMapEntry::state, LogicalRepRelMapEntry::statelsn, table_close(), table_open(), try_table_open(), and TupleDescAttr.
Referenced by apply_handle_delete(), apply_handle_insert(), apply_handle_truncate(), apply_handle_update(), and copy_table().
|
static |
Definition at line 132 of file relation.c.
References LogicalRepRelation::attkeys, LogicalRepRelation::attnames, LogicalRepRelMapEntry::attrmap, LogicalRepRelation::atttyps, bms_free(), free_attrmap(), i, LogicalRepRelation::natts, LogicalRepRelation::nspname, pfree(), LogicalRepRelation::relname, and LogicalRepRelMapEntry::remoterel.
Referenced by logicalrep_partmap_reset_relmap(), and logicalrep_relmap_update().
|
static |
Definition at line 105 of file relation.c.
References ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate, CacheMemoryContext, CacheRegisterRelcacheCallback(), ctl, HASH_BLOBS, HASH_CONTEXT, hash_create(), HASH_ELEM, logicalrep_relmap_invalidate_cb(), LogicalRepRelMap, and LogicalRepRelMapContext.
Referenced by logicalrep_rel_open(), and logicalrep_relmap_update().
Definition at line 64 of file relation.c.
References hash_seq_init(), hash_seq_search(), hash_seq_term(), InvalidOid, LogicalRepRelMapEntry::localreloid, LogicalRepRelMapEntry::localrelvalid, and LogicalRepRelMap.
Referenced by logicalrep_relmap_init().
void logicalrep_relmap_update | ( | LogicalRepRelation * | remoterel | ) |
Definition at line 164 of file relation.c.
References LogicalRepRelation::attkeys, LogicalRepRelation::attnames, LogicalRepRelation::atttyps, bms_copy(), HASH_ENTER, hash_search(), i, logicalrep_relmap_free_entry(), logicalrep_relmap_init(), LogicalRepRelMap, LogicalRepRelMapContext, MemoryContextSwitchTo(), LogicalRepRelation::natts, LogicalRepRelation::nspname, palloc(), pstrdup(), LogicalRepRelation::relname, LogicalRepRelation::remoteid, LogicalRepRelMapEntry::remoterel, and LogicalRepRelation::replident.
Referenced by apply_handle_relation(), and copy_table().
|
static |
Definition at line 226 of file relation.c.
References _, appendStringInfo(), LogicalRepRelation::attnames, bms_is_empty, bms_next_member(), StringInfoData::data, ereport, errcode(), errmsg_plural(), ERROR, i, initStringInfo(), LogicalRepRelation::nspname, and LogicalRepRelation::relname.
Referenced by logicalrep_rel_open().
|
static |
Definition at line 50 of file relation.c.
Referenced by logicalrep_partition_open(), logicalrep_partmap_init(), logicalrep_partmap_invalidate_cb(), and logicalrep_partmap_reset_relmap().
|
static |
Definition at line 49 of file relation.c.
Referenced by logicalrep_partition_open(), and logicalrep_partmap_init().
|
static |
Definition at line 36 of file relation.c.
Referenced by logicalrep_rel_open(), logicalrep_relmap_init(), logicalrep_relmap_invalidate_cb(), and logicalrep_relmap_update().
|
static |
Definition at line 34 of file relation.c.
Referenced by logicalrep_rel_open(), logicalrep_relmap_init(), and logicalrep_relmap_update().