PostgreSQL Source Code git master
Loading...
Searching...
No Matches
logicalrelation.h File Reference
Include dependency graph for logicalrelation.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  LogicalRepRelMapEntry
 

Typedefs

typedef struct LogicalRepRelMapEntry LogicalRepRelMapEntry
 

Functions

void logicalrep_relmap_update (LogicalRepRelation *remoterel)
 
void logicalrep_partmap_reset_relmap (LogicalRepRelation *remoterel)
 
LogicalRepRelMapEntrylogicalrep_rel_open (LogicalRepRelId remoteid, LOCKMODE lockmode)
 
LogicalRepRelMapEntrylogicalrep_partition_open (LogicalRepRelMapEntry *root, Relation partrel, AttrMap *map)
 
void logicalrep_rel_close (LogicalRepRelMapEntry *rel, LOCKMODE lockmode)
 
bool IsIndexUsableForReplicaIdentityFull (Relation idxrel, AttrMap *attrmap)
 
Oid GetRelationIdentityOrPK (Relation rel)
 

Typedef Documentation

◆ LogicalRepRelMapEntry

Function Documentation

◆ GetRelationIdentityOrPK()

Oid GetRelationIdentityOrPK ( Relation  rel)
extern

Definition at line 905 of file relation.c.

906{
907 Oid idxoid;
908
910
911 if (!OidIsValid(idxoid))
913
914 return idxoid;
915}
#define OidIsValid(objectId)
Definition c.h:788
unsigned int Oid
static int fb(int x)
Oid RelationGetPrimaryKeyIndex(Relation relation, bool deferrable_ok)
Definition relcache.c:5042
Oid RelationGetReplicaIndex(Relation relation)
Definition relcache.c:5067

References fb(), OidIsValid, RelationGetPrimaryKeyIndex(), and RelationGetReplicaIndex().

Referenced by check_relation_updatable(), FindLogicalRepLocalIndex(), FindReplTupleInLocalRel(), get_tuple_desc(), RelationFindDeletedTupleInfoByIndex(), and RelationFindReplTupleByIndex().

◆ IsIndexUsableForReplicaIdentityFull()

bool IsIndexUsableForReplicaIdentityFull ( Relation  idxrel,
AttrMap attrmap 
)
extern

Definition at line 835 of file relation.c.

836{
839
840 /* The index must not be a partial index */
841 if (!heap_attisnull(idxrel->rd_indextuple, Anum_pg_index_indpred, NULL))
842 return false;
843
844 Assert(idxrel->rd_index->indnatts >= 1);
845
847 idxrel->rd_indextuple,
849
850 /* Ensure that the index has a valid equal strategy for each key column */
851 for (int i = 0; i < idxrel->rd_index->indnkeyatts; i++)
852 {
853 Oid opfamily;
854
855 opfamily = get_opclass_family(indclass->values[i]);
856 if (IndexAmTranslateCompareType(COMPARE_EQ, idxrel->rd_rel->relam, opfamily, true) == InvalidStrategy)
857 return false;
858 }
859
860 /*
861 * For indexes other than PK and REPLICA IDENTITY, we need to match the
862 * local and remote tuples. The equality routine tuples_equal() cannot
863 * accept a data type where the type cache cannot provide an equality
864 * operator.
865 */
866 for (int i = 0; i < idxrel->rd_att->natts; i++)
867 {
868 TypeCacheEntry *typentry;
869
870 typentry = lookup_type_cache(TupleDescAttr(idxrel->rd_att, i)->atttypid, TYPECACHE_EQ_OPR_FINFO);
871 if (!OidIsValid(typentry->eq_opr_finfo.fn_oid))
872 return false;
873 }
874
875 /* The leftmost index field must not be an expression */
876 keycol = idxrel->rd_index->indkey.values[0];
878 return false;
879
880 /*
881 * And the leftmost index field must reference the remote relation column.
882 * This is because if it doesn't, the sequential scan is favorable over
883 * index scan in most cases.
884 */
885 if (attrmap->maplen <= AttrNumberGetAttrOffset(keycol) ||
887 return false;
888
889 /*
890 * The given index access method must implement "amgettuple", which will
891 * be used later to fetch the tuples. See RelationFindReplTupleByIndex().
892 */
893 if (GetIndexAmRoutineByAmId(idxrel->rd_rel->relam, false)->amgettuple == NULL)
894 return false;
895
896 return true;
897}
const IndexAmRoutine * GetIndexAmRoutineByAmId(Oid amoid, bool noerror)
Definition amapi.c:69
StrategyNumber IndexAmTranslateCompareType(CompareType cmptype, Oid amoid, Oid opfamily, bool missing_ok)
Definition amapi.c:161
int16 AttrNumber
Definition attnum.h:21
#define AttributeNumberIsValid(attributeNumber)
Definition attnum.h:34
#define AttrNumberGetAttrOffset(attNum)
Definition attnum.h:51
#define Assert(condition)
Definition c.h:873
@ COMPARE_EQ
Definition cmptype.h:36
bool heap_attisnull(HeapTuple tup, int attnum, TupleDesc tupleDesc)
Definition heaptuple.c:456
int i
Definition isn.c:77
Oid get_opclass_family(Oid opclass)
Definition lsyscache.c:1292
static Pointer DatumGetPointer(Datum X)
Definition postgres.h:342
#define InvalidStrategy
Definition stratnum.h:24
int maplen
Definition attmap.h:37
AttrNumber * attnums
Definition attmap.h:36
Oid fn_oid
Definition fmgr.h:59
amgettuple_function amgettuple
Definition amapi.h:311
FmgrInfo eq_opr_finfo
Definition typcache.h:76
Definition c.h:745
Datum SysCacheGetAttrNotNull(int cacheId, HeapTuple tup, AttrNumber attributeNumber)
Definition syscache.c:625
static FormData_pg_attribute * TupleDescAttr(TupleDesc tupdesc, int i)
Definition tupdesc.h:160
TypeCacheEntry * lookup_type_cache(Oid type_id, int flags)
Definition typcache.c:386
#define TYPECACHE_EQ_OPR_FINFO
Definition typcache.h:143

References IndexAmRoutine::amgettuple, Assert, AttrMap::attnums, AttributeNumberIsValid, AttrNumberGetAttrOffset, COMPARE_EQ, DatumGetPointer(), TypeCacheEntry::eq_opr_finfo, fb(), FmgrInfo::fn_oid, get_opclass_family(), GetIndexAmRoutineByAmId(), heap_attisnull(), i, IndexAmTranslateCompareType(), InvalidStrategy, lookup_type_cache(), AttrMap::maplen, OidIsValid, SysCacheGetAttrNotNull(), TupleDescAttr(), and TYPECACHE_EQ_OPR_FINFO.

Referenced by FindReplTupleInLocalRel(), and FindUsableIndexForReplicaIdentityFull().

◆ logicalrep_partition_open()

LogicalRepRelMapEntry * logicalrep_partition_open ( LogicalRepRelMapEntry root,
Relation  partrel,
AttrMap map 
)
extern

Definition at line 647 of file relation.c.

649{
652 LogicalRepRelation *remoterel = &root->remoterel;
653 Oid partOid = RelationGetRelid(partrel);
654 AttrMap *attrmap = root->attrmap;
655 bool found;
657
658 if (LogicalRepPartMap == NULL)
660
661 /* Search for existing entry. */
663 &partOid,
664 HASH_ENTER, &found);
665
666 entry = &part_entry->relmapentry;
667
668 /*
669 * We must always overwrite entry->localrel with the latest partition
670 * Relation pointer, because the Relation pointed to by the old value may
671 * have been cleared after the caller would have closed the partition
672 * relation after the last use of this entry. Note that localrelvalid is
673 * only updated by the relcache invalidation callback, so it may still be
674 * true irrespective of whether the Relation pointed to by localrel has
675 * been cleared or not.
676 */
677 if (found && entry->localrelvalid)
678 {
679 entry->localrel = partrel;
680 return entry;
681 }
682
683 /* Switch to longer-lived context. */
685
686 if (!found)
687 {
689 part_entry->partoid = partOid;
690 }
691
692 /* Release the no-longer-useful attrmap, if any. */
693 if (entry->attrmap)
694 {
695 free_attrmap(entry->attrmap);
696 entry->attrmap = NULL;
697 }
698
699 if (!entry->remoterel.remoteid)
700 {
701 int i;
702
703 /* Remote relation is copied as-is from the root entry. */
704 entry->remoterel.remoteid = remoterel->remoteid;
705 entry->remoterel.nspname = pstrdup(remoterel->nspname);
706 entry->remoterel.relname = pstrdup(remoterel->relname);
707 entry->remoterel.natts = remoterel->natts;
708 entry->remoterel.attnames = palloc_array(char *, remoterel->natts);
709 entry->remoterel.atttyps = palloc_array(Oid, remoterel->natts);
710 for (i = 0; i < remoterel->natts; i++)
711 {
712 entry->remoterel.attnames[i] = pstrdup(remoterel->attnames[i]);
713 entry->remoterel.atttyps[i] = remoterel->atttyps[i];
714 }
715 entry->remoterel.replident = remoterel->replident;
716 entry->remoterel.attkeys = bms_copy(remoterel->attkeys);
717 }
718
719 entry->localrel = partrel;
720 entry->localreloid = partOid;
721
722 /*
723 * If the partition's attributes don't match the root relation's, we'll
724 * need to make a new attrmap which maps partition attribute numbers to
725 * remoterel's, instead of the original which maps root relation's
726 * attribute numbers to remoterel's.
727 *
728 * Note that 'map' which comes from the tuple routing data structure
729 * contains 1-based attribute numbers (of the parent relation). However,
730 * the map in 'entry', a logical replication data structure, contains
731 * 0-based attribute numbers (of the remote relation).
732 */
733 if (map)
734 {
735 AttrNumber attno;
736
737 entry->attrmap = make_attrmap(map->maplen);
738 for (attno = 0; attno < entry->attrmap->maplen; attno++)
739 {
740 AttrNumber root_attno = map->attnums[attno];
741
742 /* 0 means it's a dropped attribute. See comments atop AttrMap. */
743 if (root_attno == 0)
744 entry->attrmap->attnums[attno] = -1;
745 else
746 entry->attrmap->attnums[attno] = attrmap->attnums[root_attno - 1];
747 }
748 }
749 else
750 {
751 /* Lacking copy_attmap, do this the hard way. */
752 entry->attrmap = make_attrmap(attrmap->maplen);
753 memcpy(entry->attrmap->attnums, attrmap->attnums,
754 attrmap->maplen * sizeof(AttrNumber));
755 }
756
757 /* Set if the table's replica identity is enough to apply update/delete. */
759
760 /* state and statelsn are left set to 0. */
762
763 /*
764 * Finding a usable index is an infrequent task. It occurs when an
765 * operation is first performed on the relation, or after invalidation of
766 * the relation cache entry (such as ANALYZE or CREATE/DROP index on the
767 * relation).
768 *
769 * We also prefer to run this code on the oldctx so that we do not leak
770 * anything in the LogicalRepPartMapContext (hence CacheMemoryContext).
771 */
772 entry->localindexoid = FindLogicalRepLocalIndex(partrel, remoterel,
773 entry->attrmap);
774
775 entry->localrelvalid = true;
776
777 return entry;
778}
void free_attrmap(AttrMap *map)
Definition attmap.c:56
AttrMap * make_attrmap(int maplen)
Definition attmap.c:40
Bitmapset * bms_copy(const Bitmapset *a)
Definition bitmapset.c:122
void * hash_search(HTAB *hashp, const void *keyPtr, HASHACTION action, bool *foundPtr)
Definition dynahash.c:952
#define palloc_array(type, count)
Definition fe_memutils.h:76
@ HASH_ENTER
Definition hsearch.h:114
char * pstrdup(const char *in)
Definition mcxt.c:1781
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
Definition palloc.h:124
tree ctl root
Definition radixtree.h:1857
#define RelationGetRelid(relation)
Definition rel.h:514
static MemoryContext LogicalRepPartMapContext
Definition relation.c:50
static void logicalrep_partmap_init(void)
Definition relation.c:612
static HTAB * LogicalRepPartMap
Definition relation.c:51
static void logicalrep_rel_mark_updatable(LogicalRepRelMapEntry *entry)
Definition relation.c:309
static Oid FindLogicalRepLocalIndex(Relation localrel, LogicalRepRelation *remoterel, AttrMap *attrMap)
Definition relation.c:922
LogicalRepRelation remoterel
LogicalRepRelId remoteid
Bitmapset * attkeys

References LogicalRepRelation::attkeys, LogicalRepRelation::attnames, AttrMap::attnums, LogicalRepRelMapEntry::attrmap, LogicalRepRelation::atttyps, bms_copy(), fb(), 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_array, pstrdup(), RelationGetRelid, LogicalRepRelation::relname, LogicalRepRelation::remoteid, LogicalRepRelMapEntry::remoterel, LogicalRepRelation::replident, and root.

Referenced by apply_handle_tuple_routing().

◆ logicalrep_partmap_reset_relmap()

void logicalrep_partmap_reset_relmap ( LogicalRepRelation remoterel)
extern

Definition at line 585 of file relation.c.

586{
587 HASH_SEQ_STATUS status;
590
591 if (LogicalRepPartMap == NULL)
592 return;
593
595 while ((part_entry = (LogicalRepPartMapEntry *) hash_seq_search(&status)) != NULL)
596 {
597 entry = &part_entry->relmapentry;
598
599 if (entry->remoterel.remoteid != remoterel->remoteid)
600 continue;
601
603
604 memset(entry, 0, sizeof(LogicalRepRelMapEntry));
605 }
606}
void * hash_seq_search(HASH_SEQ_STATUS *status)
Definition dynahash.c:1415
void hash_seq_init(HASH_SEQ_STATUS *status, HTAB *hashp)
Definition dynahash.c:1380
static void logicalrep_relmap_free_entry(LogicalRepRelMapEntry *entry)
Definition relation.c:133

References fb(), hash_seq_init(), hash_seq_search(), logicalrep_relmap_free_entry(), LogicalRepPartMap, LogicalRepRelation::remoteid, and LogicalRepRelMapEntry::remoterel.

Referenced by apply_handle_relation().

◆ logicalrep_rel_close()

void logicalrep_rel_close ( LogicalRepRelMapEntry rel,
LOCKMODE  lockmode 
)
extern

Definition at line 518 of file relation.c.

519{
520 table_close(rel->localrel, lockmode);
521 rel->localrel = NULL;
522}
void table_close(Relation relation, LOCKMODE lockmode)
Definition table.c:126

References fb(), LogicalRepRelMapEntry::localrel, and table_close().

Referenced by apply_handle_delete(), apply_handle_insert(), apply_handle_truncate(), apply_handle_update(), and copy_table().

◆ logicalrep_rel_open()

LogicalRepRelMapEntry * logicalrep_rel_open ( LogicalRepRelId  remoteid,
LOCKMODE  lockmode 
)
extern

Definition at line 362 of file relation.c.

363{
365 bool found;
366 LogicalRepRelation *remoterel;
367
368 if (LogicalRepRelMap == NULL)
370
371 /* Search for existing entry. */
372 entry = hash_search(LogicalRepRelMap, &remoteid,
373 HASH_FIND, &found);
374
375 if (!found)
376 elog(ERROR, "no relation map entry for remote relation ID %u",
377 remoteid);
378
379 remoterel = &entry->remoterel;
380
381 /* Ensure we don't leak a relcache refcount. */
382 if (entry->localrel)
383 elog(ERROR, "remote relation ID %u is already open", remoteid);
384
385 /*
386 * When opening and locking a relation, pending invalidation messages are
387 * processed which can invalidate the relation. Hence, if the entry is
388 * currently considered valid, try to open the local relation by OID and
389 * see if invalidation ensues.
390 */
391 if (entry->localrelvalid)
392 {
393 entry->localrel = try_table_open(entry->localreloid, lockmode);
394 if (!entry->localrel)
395 {
396 /* Table was renamed or dropped. */
397 entry->localrelvalid = false;
398 }
399 else if (!entry->localrelvalid)
400 {
401 /* Note we release the no-longer-useful lock here. */
402 table_close(entry->localrel, lockmode);
403 entry->localrel = NULL;
404 }
405 }
406
407 /*
408 * If the entry has been marked invalid since we last had lock on it,
409 * re-open the local relation by name and rebuild all derived data.
410 */
411 if (!entry->localrelvalid)
412 {
413 Oid relid;
414 TupleDesc desc;
416 int i;
419
420 /* Release the no-longer-useful attrmap, if any. */
421 if (entry->attrmap)
422 {
423 free_attrmap(entry->attrmap);
424 entry->attrmap = NULL;
425 }
426
427 /* Try to find and lock the relation by name. */
428 relid = RangeVarGetRelid(makeRangeVar(remoterel->nspname,
429 remoterel->relname, -1),
430 lockmode, true);
431 if (!OidIsValid(relid))
434 errmsg("logical replication target relation \"%s.%s\" does not exist",
435 remoterel->nspname, remoterel->relname)));
436 entry->localrel = table_open(relid, NoLock);
437 entry->localreloid = relid;
438
439 /* Check for supported relkind. */
441 remoterel->relkind,
442 remoterel->nspname, remoterel->relname);
443
444 /*
445 * Build the mapping of local attribute numbers to remote attribute
446 * numbers and validate that we don't miss any replicated columns as
447 * that would result in potentially unwanted data loss.
448 */
449 desc = RelationGetDescr(entry->localrel);
451 entry->attrmap = make_attrmap(desc->natts);
453
454 /* check and report missing attrs, if any */
455 missingatts = bms_add_range(NULL, 0, remoterel->natts - 1);
456 for (i = 0; i < desc->natts; i++)
457 {
458 int attnum;
459 Form_pg_attribute attr = TupleDescAttr(desc, i);
460
461 if (attr->attisdropped)
462 {
463 entry->attrmap->attnums[i] = -1;
464 continue;
465 }
466
468 NameStr(attr->attname));
469
470 entry->attrmap->attnums[i] = attnum;
471 if (attnum >= 0)
472 {
473 /* Remember which subscriber columns are generated. */
474 if (attr->attgenerated)
476
478 }
479 }
480
483
484 /* be tidy */
487
488 /*
489 * Set if the table's replica identity is enough to apply
490 * update/delete.
491 */
493
494 /*
495 * Finding a usable index is an infrequent task. It occurs when an
496 * operation is first performed on the relation, or after invalidation
497 * of the relation cache entry (such as ANALYZE or CREATE/DROP index
498 * on the relation).
499 */
500 entry->localindexoid = FindLogicalRepLocalIndex(entry->localrel, remoterel,
501 entry->attrmap);
502
503 entry->localrelvalid = true;
504 }
505
506 if (entry->state != SUBREL_STATE_READY)
508 entry->localreloid,
509 &entry->statelsn);
510
511 return entry;
512}
Subscription * MySubscription
Definition worker.c:479
Bitmapset * bms_add_range(Bitmapset *a, int lower, int upper)
Definition bitmapset.c:1018
Bitmapset * bms_del_member(Bitmapset *a, int x)
Definition bitmapset.c:867
void bms_free(Bitmapset *a)
Definition bitmapset.c:239
Bitmapset * bms_add_member(Bitmapset *a, int x)
Definition bitmapset.c:814
#define NameStr(name)
Definition c.h:765
int errcode(int sqlerrcode)
Definition elog.c:863
int errmsg(const char *fmt,...)
Definition elog.c:1080
#define ERROR
Definition elog.h:39
#define elog(elevel,...)
Definition elog.h:226
#define ereport(elevel,...)
Definition elog.h:150
void CheckSubscriptionRelkind(char localrelkind, char remoterelkind, const char *nspname, const char *relname)
@ HASH_FIND
Definition hsearch.h:113
#define NoLock
Definition lockdefs.h:34
RangeVar * makeRangeVar(char *schemaname, char *relname, int location)
Definition makefuncs.c:473
#define RangeVarGetRelid(relation, lockmode, missing_ok)
Definition namespace.h:98
int16 attnum
FormData_pg_attribute * Form_pg_attribute
char GetSubscriptionRelState(Oid subid, Oid relid, XLogRecPtr *sublsn)
#define RelationGetDescr(relation)
Definition rel.h:540
static void logicalrep_report_missing_or_gen_attrs(LogicalRepRelation *remoterel, Bitmapset *missingatts, Bitmapset *generatedatts)
Definition relation.c:268
static HTAB * LogicalRepRelMap
Definition relation.c:37
static MemoryContext LogicalRepRelMapContext
Definition relation.c:35
static void logicalrep_relmap_init(void)
Definition relation.c:106
static int logicalrep_rel_att_by_name(LogicalRepRelation *remoterel, const char *attname)
Definition relation.c:221
Form_pg_class rd_rel
Definition rel.h:111
Relation try_table_open(Oid relationId, LOCKMODE lockmode)
Definition table.c:60
Relation table_open(Oid relationId, LOCKMODE lockmode)
Definition table.c:40

References attnum, AttrMap::attnums, LogicalRepRelMapEntry::attrmap, bms_add_member(), bms_add_range(), bms_del_member(), bms_free(), CheckSubscriptionRelkind(), elog, ereport, errcode(), errmsg(), ERROR, fb(), 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_or_gen_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::relkind, 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().

◆ logicalrep_relmap_update()

void logicalrep_relmap_update ( LogicalRepRelation remoterel)
extern

Definition at line 165 of file relation.c.

166{
169 bool found;
170 int i;
171
172 if (LogicalRepRelMap == NULL)
174
175 /*
176 * HASH_ENTER returns the existing entry if present or creates a new one.
177 */
178 entry = hash_search(LogicalRepRelMap, &remoterel->remoteid,
179 HASH_ENTER, &found);
180
181 if (found)
183
184 memset(entry, 0, sizeof(LogicalRepRelMapEntry));
185
186 /* Make cached copy of the data */
188 entry->remoterel.remoteid = remoterel->remoteid;
189 entry->remoterel.nspname = pstrdup(remoterel->nspname);
190 entry->remoterel.relname = pstrdup(remoterel->relname);
191 entry->remoterel.natts = remoterel->natts;
192 entry->remoterel.attnames = palloc_array(char *, remoterel->natts);
193 entry->remoterel.atttyps = palloc_array(Oid, remoterel->natts);
194 for (i = 0; i < remoterel->natts; i++)
195 {
196 entry->remoterel.attnames[i] = pstrdup(remoterel->attnames[i]);
197 entry->remoterel.atttyps[i] = remoterel->atttyps[i];
198 }
199 entry->remoterel.replident = remoterel->replident;
200
201 /*
202 * XXX The walsender currently does not transmit the relkind of the remote
203 * relation when replicating changes. Since we support replicating only
204 * table changes at present, we default to initializing relkind as
205 * RELKIND_RELATION. This is needed in CheckSubscriptionRelkind() to check
206 * if the publisher and subscriber relation kinds are compatible.
207 */
208 entry->remoterel.relkind =
209 (remoterel->relkind == 0) ? RELKIND_RELATION : remoterel->relkind;
210
211 entry->remoterel.attkeys = bms_copy(remoterel->attkeys);
213}

References LogicalRepRelation::attkeys, LogicalRepRelation::attnames, LogicalRepRelation::atttyps, bms_copy(), fb(), HASH_ENTER, hash_search(), i, logicalrep_relmap_free_entry(), logicalrep_relmap_init(), LogicalRepRelMap, LogicalRepRelMapContext, MemoryContextSwitchTo(), LogicalRepRelation::natts, LogicalRepRelation::nspname, palloc_array, pstrdup(), LogicalRepRelation::relkind, LogicalRepRelation::relname, LogicalRepRelation::remoteid, LogicalRepRelMapEntry::remoterel, and LogicalRepRelation::replident.

Referenced by apply_handle_relation(), and copy_table().