mirror of https://github.com/citusdata/citus.git
Revet & Use RelationIdListHasReferenceTable
parent
349951fab7
commit
bbc3bf87fc
|
|
@ -164,26 +164,7 @@ ShouldUndistributeCitusLocalTable(Oid relationId)
|
||||||
|
|
||||||
List *fkeyConnectedRelations = GetForeignKeyConnectedRelationIdList(relationId);
|
List *fkeyConnectedRelations = GetForeignKeyConnectedRelationIdList(relationId);
|
||||||
|
|
||||||
if (fkeyConnectedRelations == NIL)
|
return RelationIdListHasReferenceTable(fkeyConnectedRelations);
|
||||||
{
|
|
||||||
/* 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)
|
|
||||||
{
|
|
||||||
if (IsCitusTableType(relationOid, REFERENCE_TABLE))
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
* The relation is connected to a reference table via foreign keys,
|
|
||||||
* we shouldn't undistribute it.
|
|
||||||
*/
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue