mirror of https://github.com/citusdata/citus.git
Convert all to CLT if a partition has an external foreign key
parent
723db5c8cf
commit
a18afc5362
|
@ -371,9 +371,24 @@ ExecuteCascadeOperationForRelationIdList(List *relationIdList,
|
||||||
case CASCADE_FKEY_ADD_LOCAL_TABLE_TO_METADATA:
|
case CASCADE_FKEY_ADD_LOCAL_TABLE_TO_METADATA:
|
||||||
{
|
{
|
||||||
if (!IsCitusTable(relationId))
|
if (!IsCitusTable(relationId))
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* If it's a partition, we want whole partitioned table to become a
|
||||||
|
* Citus Local Table. For that, we start conversion from the parent.
|
||||||
|
*/
|
||||||
|
if (PartitionTable(relationId))
|
||||||
|
{
|
||||||
|
Oid parentOid = PartitionParentOid(relationId);
|
||||||
|
if (OidIsValid(parentOid) && !IsCitusTable(parentOid))
|
||||||
|
{
|
||||||
|
CreateCitusLocalTable(parentOid, cascadeViaForeignKeys);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
CreateCitusLocalTable(relationId, cascadeViaForeignKeys);
|
CreateCitusLocalTable(relationId, cascadeViaForeignKeys);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue