105 "LogicalRepRelMapContext",
134 if (remoterel->
natts > 0)
138 for (
i = 0;
i < remoterel->
natts;
i++)
186 for (
i = 0;
i < remoterel->
natts;
i++)
206 for (
i = 0;
i < remoterel->
natts;
i++)
225 int missingattcnt = 0;
233 if (missingattcnt == 1)
242 (
errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
243 errmsg_plural(
"logical replication target relation \"%s.%s\" is missing replicated column: %s",
244 "logical replication target relation \"%s.%s\" is missing replicated columns: %s",
248 missingattsbuf.
data)));
286 if (idkey == NULL && remoterel->
replident != REPLICA_IDENTITY_FULL)
297 (
errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
298 errmsg(
"logical replication target relation \"%s.%s\" uses "
299 "system columns in REPLICA IDENTITY index",
333 elog(
ERROR,
"no relation map entry for remote relation ID %u",
340 elog(
ERROR,
"remote relation ID %u is already open", remoteid);
389 (
errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
390 errmsg(
"logical replication target relation \"%s.%s\" does not exist",
416 if (attr->attisdropped || attr->attgenerated)
444 if (entry->
state != SUBREL_STATE_READY)
557 "LogicalRepPartMapContext",
649 for (
i = 0;
i < remoterel->
natts;
i++)
void free_attrmap(AttrMap *map)
AttrMap * make_attrmap(int maplen)
#define AttrNumberGetAttrOffset(attNum)
#define AttrNumberIsForUserDefinedAttr(attributeNumber)
Subscription * MySubscription
int bms_next_member(const Bitmapset *a, int prevbit)
void bms_free(Bitmapset *a)
bool bms_is_member(int x, const Bitmapset *a)
Bitmapset * bms_del_member(Bitmapset *a, int x)
bool bms_is_empty(const Bitmapset *a)
Bitmapset * bms_copy(const Bitmapset *a)
Bitmapset * bms_add_range(Bitmapset *a, int lower, int upper)
int bms_first_member(Bitmapset *a)
#define OidIsValid(objectId)
elog(ERROR, "%s: %s", p2, msg)
void * hash_search(HTAB *hashp, const void *keyPtr, HASHACTION action, bool *foundPtr)
void hash_seq_term(HASH_SEQ_STATUS *status)
HTAB * hash_create(const char *tabname, long nelem, const HASHCTL *info, int flags)
void * hash_seq_search(HASH_SEQ_STATUS *status)
void hash_seq_init(HASH_SEQ_STATUS *status, HTAB *hashp)
int errmsg_plural(const char *fmt_singular, const char *fmt_plural, unsigned long n,...)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
void CheckSubscriptionRelkind(char relkind, const char *nspname, const char *relname)
void CacheRegisterRelcacheCallback(RelcacheCallbackFunction func, Datum arg)
struct LogicalRepRelMapEntry LogicalRepRelMapEntry
RangeVar * makeRangeVar(char *schemaname, char *relname, int location)
char * pstrdup(const char *in)
void pfree(void *pointer)
MemoryContext CacheMemoryContext
#define AllocSetContextCreate
#define ALLOCSET_DEFAULT_SIZES
#define RangeVarGetRelid(relation, lockmode, missing_ok)
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
FormData_pg_attribute * Form_pg_attribute
static void static void status(const char *fmt,...) pg_attribute_printf(1
char GetSubscriptionRelState(Oid subid, Oid relid, XLogRecPtr *sublsn)
#define RelationGetRelid(relation)
#define RelationGetDescr(relation)
Bitmapset * RelationGetIndexAttrBitmap(Relation relation, IndexAttrBitmapKind attrKind)
@ INDEX_ATTR_BITMAP_PRIMARY_KEY
@ INDEX_ATTR_BITMAP_IDENTITY_KEY
static MemoryContext LogicalRepPartMapContext
void logicalrep_partmap_reset_relmap(LogicalRepRelation *remoterel)
static void logicalrep_partmap_init(void)
static void logicalrep_report_missing_attrs(LogicalRepRelation *remoterel, Bitmapset *missingatts)
static void logicalrep_relmap_free_entry(LogicalRepRelMapEntry *entry)
LogicalRepRelMapEntry * logicalrep_partition_open(LogicalRepRelMapEntry *root, Relation partrel, AttrMap *map)
struct LogicalRepPartMapEntry LogicalRepPartMapEntry
static void logicalrep_partmap_invalidate_cb(Datum arg, Oid reloid)
static HTAB * LogicalRepPartMap
static HTAB * LogicalRepRelMap
static void logicalrep_rel_mark_updatable(LogicalRepRelMapEntry *entry)
static MemoryContext LogicalRepRelMapContext
void logicalrep_relmap_update(LogicalRepRelation *remoterel)
static void logicalrep_relmap_init(void)
LogicalRepRelMapEntry * logicalrep_rel_open(LogicalRepRelId remoteid, LOCKMODE lockmode)
static int logicalrep_rel_att_by_name(LogicalRepRelation *remoterel, const char *attname)
static void logicalrep_relmap_invalidate_cb(Datum arg, Oid reloid)
void logicalrep_rel_close(LogicalRepRelMapEntry *rel, LOCKMODE lockmode)
void appendStringInfo(StringInfo str, const char *fmt,...)
void initStringInfo(StringInfo str)
LogicalRepRelMapEntry relmapentry
LogicalRepRelation remoterel
#define FirstLowInvalidHeapAttributeNumber
Relation try_table_open(Oid relationId, LOCKMODE lockmode)
void table_close(Relation relation, LOCKMODE lockmode)
Relation table_open(Oid relationId, LOCKMODE lockmode)
#define TupleDescAttr(tupdesc, i)