mirror of https://github.com/citusdata/citus.git
parent
be2e18e4bf
commit
0e85d8806c
|
@ -251,19 +251,6 @@ PostprocessCreateTableStmtPartitionOf(CreateStmt *createStatement, const
|
||||||
CreateDistributedTable(relationId, parentDistributionColumn,
|
CreateDistributedTable(relationId, parentDistributionColumn,
|
||||||
parentDistributionMethod, parentRelationName,
|
parentDistributionMethod, parentRelationName,
|
||||||
viaDeprecatedAPI);
|
viaDeprecatedAPI);
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* If parent is a postgres local table, then invalidate foreign key cache
|
|
||||||
* if the parent table is involved in any foreign key relationship. This is
|
|
||||||
* because, partition tables inherit foreign keys from parent tables.
|
|
||||||
* Note that if parent table is a citus table, then CreateDistributedTable
|
|
||||||
* already invalidates foreign key cache and we handle that case above.
|
|
||||||
*/
|
|
||||||
if ((TableReferenced(parentRelationId) || TableReferencing(parentRelationId)))
|
|
||||||
{
|
|
||||||
InvalidateForeignKeyGraph();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -339,23 +326,6 @@ PostprocessAlterTableStmtAttachPartition(AlterTableStmt *alterTableStatement,
|
||||||
distributionMethod, parentRelationName,
|
distributionMethod, parentRelationName,
|
||||||
viaDeprecatedAPI);
|
viaDeprecatedAPI);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!IsCitusTable(relationId) &&
|
|
||||||
!IsCitusTable(partitionRelationId))
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
* If parent and child tables are postgres local tables, then invalidate
|
|
||||||
* foreign key cache if the parent table is involved in any foreign key
|
|
||||||
* relationship. This is because, partition tables inherit foreign keys
|
|
||||||
* from parent tables.
|
|
||||||
* Note that if parent table is a citus table, then CreateDistributedTable
|
|
||||||
* already invalidates foreign key cache and we handle that case above.
|
|
||||||
*/
|
|
||||||
if ((TableReferenced(relationId) || TableReferencing(relationId)))
|
|
||||||
{
|
|
||||||
InvalidateForeignKeyGraph();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue