Check the relation itself, if no fkey is found

talha_tes1
Ahmet Gedemenli 2021-09-27 15:17:18 +03:00
parent 7e8185b3ce
commit 8f5bc36b38
1 changed files with 7 additions and 0 deletions

View File

@ -153,6 +153,13 @@ ShouldUndistributeCitusLocalTable(Oid relationId)
InvalidateForeignKeyGraph();
List *fkeyConnectedRelations = GetForeignKeyConnectedRelationIdList(relationId);
if (fkeyConnectedRelations == NIL)
{
/* if no fkey connection is found, we should only check the relation itself */
fkeyConnectedRelations = lappend_oid(fkeyConnectedRelations, relationId);
}
Oid relationOid = InvalidOid;
foreach_oid(relationOid, fkeyConnectedRelations)
{