PostgreSQL Source Code
git master
|
#include "postgres.h"
#include "access/sysattr.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/builtins.h"
#include "utils/inval.h"
#include "utils/lsyscache.h"
#include "utils/memutils.h"
#include "utils/syscache.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 HTAB * | LogicalRepTypMap = NULL |
static MemoryContext | LogicalRepPartMapContext = NULL |
static HTAB * | LogicalRepPartMap = NULL |
typedef struct LogicalRepPartMapEntry LogicalRepPartMapEntry |
LogicalRepRelMapEntry* logicalrep_partition_open | ( | LogicalRepRelMapEntry * | root, |
Relation | partrel, | ||
AttrMap * | map | ||
) |
Definition at line 629 of file relation.c.
References LogicalRepRelation::attkeys, LogicalRepRelation::attnames, AttrMap::attnums, LogicalRepRelMapEntry::attrmap, LogicalRepRelation::atttyps, bms_copy(), HASH_ENTER, hash_search(), i, LogicalRepRelMapEntry::localrel, LogicalRepRelMapEntry::localreloid, LogicalRepRelMapEntry::localrelvalid, logicalrep_partmap_init(), 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 LogicalRepRelMapEntry::updatable.
Referenced by apply_handle_tuple_routing().
|
static |
Definition at line 596 of file relation.c.
References ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate, CacheMemoryContext, CacheRegisterRelcacheCallback(), HASHCTL::entrysize, HASH_BLOBS, HASH_CONTEXT, hash_create(), HASH_ELEM, HASHCTL::hcxt, HASHCTL::keysize, logicalrep_partmap_invalidate_cb(), and LogicalRepPartMapContext.
Referenced by logicalrep_partition_open().
Definition at line 555 of file relation.c.
References hash_seq_init(), hash_seq_search(), hash_seq_term(), InvalidOid, LogicalRepRelMapEntry::localreloid, LogicalRepRelMapEntry::localrelvalid, and status().
Referenced by logicalrep_partmap_init().
|
static |
Definition at line 216 of file relation.c.
References LogicalRepRelation::attnames, i, and LogicalRepRelation::natts.
Referenced by logicalrep_rel_open().
void logicalrep_rel_close | ( | LogicalRepRelMapEntry * | rel, |
LOCKMODE | lockmode | ||
) |
Definition at line 447 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().
LogicalRepRelMapEntry* logicalrep_rel_open | ( | LogicalRepRelId | remoteid, |
LOCKMODE | lockmode | ||
) |
Definition at line 272 of file relation.c.
References LogicalRepRelation::attkeys, attnum, AttrMap::attnums, LogicalRepRelMapEntry::attrmap, AttrNumberGetAttrOffset, AttrNumberIsForUserDefinedAttr, bms_add_range(), bms_del_member(), bms_free(), bms_is_member(), bms_next_member(), CheckSubscriptionRelkind(), elog, ereport, errcode(), errmsg(), ERROR, FirstLowInvalidHeapAttributeNumber, GetSubscriptionRelState(), HASH_FIND, hash_search(), i, INDEX_ATTR_BITMAP_IDENTITY_KEY, INDEX_ATTR_BITMAP_PRIMARY_KEY, LogicalRepRelMapEntry::localrel, LogicalRepRelMapEntry::localreloid, LogicalRepRelMapEntry::localrelvalid, logicalrep_rel_att_by_name(), logicalrep_relmap_init(), logicalrep_report_missing_attrs(), make_attrmap(), makeRangeVar(), MemoryContextSwitchTo(), MySubscription, NameStr, TupleDescData::natts, LogicalRepRelation::natts, NoLock, LogicalRepRelation::nspname, Subscription::oid, OidIsValid, RangeVarGetRelid, RelationData::rd_rel, RelationGetDescr, RelationGetIndexAttrBitmap(), LogicalRepRelation::relname, LogicalRepRelMapEntry::remoterel, LogicalRepRelation::replident, LogicalRepRelMapEntry::state, LogicalRepRelMapEntry::statelsn, table_close(), table_open(), try_table_open(), TupleDescAttr, and LogicalRepRelMapEntry::updatable.
Referenced by apply_handle_delete(), apply_handle_insert(), apply_handle_truncate(), apply_handle_update(), and copy_table().
|
static |
Definition at line 139 of file relation.c.
References LogicalRepRelation::attkeys, LogicalRepRelation::attnames, LogicalRepRelMapEntry::attrmap, LogicalRepRelation::atttyps, bms_free(), i, LogicalRepRelation::natts, LogicalRepRelation::nspname, pfree(), LogicalRepRelation::relname, and LogicalRepRelMapEntry::remoterel.
Referenced by logicalrep_relmap_update().
|
static |
Definition at line 103 of file relation.c.
References ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate, CacheMemoryContext, CacheRegisterRelcacheCallback(), HASHCTL::entrysize, HASH_BLOBS, HASH_CONTEXT, hash_create(), HASH_ELEM, HASHCTL::hcxt, HASHCTL::keysize, logicalrep_relmap_invalidate_cb(), and LogicalRepRelMapContext.
Referenced by logicalrep_rel_open(), logicalrep_relmap_update(), and logicalrep_typmap_update().
Definition at line 62 of file relation.c.
References hash_seq_init(), hash_seq_search(), hash_seq_term(), InvalidOid, LogicalRepRelMapEntry::localreloid, LogicalRepRelMapEntry::localrelvalid, and status().
Referenced by logicalrep_relmap_init().
void logicalrep_relmap_update | ( | LogicalRepRelation * | remoterel | ) |
Definition at line 171 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(), 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 233 of file relation.c.
References _, appendStringInfo(), LogicalRepRelation::attnames, bms_first_member(), bms_is_empty(), StringInfoData::data, ereport, errcode(), errmsg_plural(), ERROR, i, initStringInfo(), LogicalRepRelation::nspname, and LogicalRepRelation::relname.
Referenced by logicalrep_rel_open().
|
static |
Definition at line 457 of file relation.c.
References LogicalRepTyp::nspname, pfree(), and LogicalRepTyp::typname.
Referenced by logicalrep_typmap_update().
char* logicalrep_typmap_gettypname | ( | Oid | remoteid | ) |
Definition at line 501 of file relation.c.
References Assert, FirstGenbkiObjectId, format_type_be(), get_typisdefined(), HASH_FIND, hash_search(), LogicalRepTyp::nspname, OidIsValid, psprintf(), LogicalRepTyp::remoteid, and LogicalRepTyp::typname.
Referenced by slot_store_error_callback().
void logicalrep_typmap_update | ( | LogicalRepTyp * | remotetyp | ) |
Definition at line 467 of file relation.c.
References HASH_ENTER, hash_search(), logicalrep_relmap_init(), logicalrep_typmap_free_entry(), MemoryContextSwitchTo(), LogicalRepTyp::nspname, pstrdup(), LogicalRepTyp::remoteid, and LogicalRepTyp::typname.
Referenced by apply_handle_type().
|
static |
Definition at line 51 of file relation.c.
|
static |
Definition at line 50 of file relation.c.
Referenced by logicalrep_partmap_init().
|
static |
Definition at line 36 of file relation.c.
|
static |
Definition at line 34 of file relation.c.
Referenced by logicalrep_relmap_init().
|
static |
Definition at line 37 of file relation.c.