mirror of https://github.com/citusdata/citus.git
Enable partitioned citus local tables
parent
6e8b19984e
commit
c4e2fe3500
|
@ -330,6 +330,17 @@ CreateCitusLocalTable(Oid relationId, bool cascadeViaForeignKeys)
|
||||||
attnumList);
|
attnumList);
|
||||||
|
|
||||||
FinalizeCitusLocalTableCreation(shellRelationId, dependentSequenceList);
|
FinalizeCitusLocalTableCreation(shellRelationId, dependentSequenceList);
|
||||||
|
|
||||||
|
/* if this table is partitioned table, add its partitions to metadata too */
|
||||||
|
if (PartitionedTable(relationId))
|
||||||
|
{
|
||||||
|
List *partitionList = PartitionList(relationId);
|
||||||
|
Oid partitionRelationId = InvalidOid;
|
||||||
|
foreach_oid(partitionRelationId, partitionList)
|
||||||
|
{
|
||||||
|
CreateCitusLocalTable(partitionRelationId, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -387,20 +398,14 @@ ErrorIfUnsupportedCitusLocalTableKind(Oid relationId)
|
||||||
"relationships", relationName)));
|
"relationships", relationName)));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (PartitionTable(relationId))
|
|
||||||
{
|
|
||||||
ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
|
||||||
errmsg("cannot add local table \"%s\" to metadata, local tables "
|
|
||||||
"added to metadata cannot be partition of other tables ",
|
|
||||||
relationName)));
|
|
||||||
}
|
|
||||||
|
|
||||||
char relationKind = get_rel_relkind(relationId);
|
char relationKind = get_rel_relkind(relationId);
|
||||||
if (!(relationKind == RELKIND_RELATION || relationKind == RELKIND_FOREIGN_TABLE))
|
if (!(relationKind == RELKIND_RELATION || relationKind == RELKIND_FOREIGN_TABLE || relationKind == RELKIND_PARTITIONED_TABLE))
|
||||||
{
|
{
|
||||||
ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
||||||
errmsg("cannot add local table \"%s\" to metadata, only regular "
|
errmsg("cannot add local table \"%s\" to metadata, only regular "
|
||||||
"tables and foreign tables can be added to citus metadata ",
|
"tables, foreign tables and partitioned tables can be "
|
||||||
|
"added to citus metadata ",
|
||||||
relationName)));
|
relationName)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -227,12 +227,6 @@ PlacementAccessTypeToText(ShardPlacementAccessType accessType)
|
||||||
static void
|
static void
|
||||||
RecordRelationAccessBase(Oid relationId, ShardPlacementAccessType accessType)
|
RecordRelationAccessBase(Oid relationId, ShardPlacementAccessType accessType)
|
||||||
{
|
{
|
||||||
/*
|
|
||||||
* We call this only for reference tables, and we don't support partitioned
|
|
||||||
* reference tables.
|
|
||||||
*/
|
|
||||||
Assert(!PartitionedTable(relationId) && !PartitionTable(relationId));
|
|
||||||
|
|
||||||
/* make sure that this is not a conflicting access */
|
/* make sure that this is not a conflicting access */
|
||||||
CheckConflictingRelationAccesses(relationId, accessType);
|
CheckConflictingRelationAccesses(relationId, accessType);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue