Readability

talha_tes1
Ahmet Gedemenli 2021-10-21 18:24:27 +03:00
parent 95021cfb55
commit 369ac2be10
3 changed files with 12 additions and 4 deletions

View File

@ -1223,7 +1223,9 @@ CreateCitusTableLike(TableConversionState *con)
} }
else if (IsCitusTableType(con->relationId, CITUS_LOCAL_TABLE)) else if (IsCitusTableType(con->relationId, CITUS_LOCAL_TABLE))
{ {
CreateCitusLocalTable(con->newRelationId, false, false); bool cascade = false;
bool autoConverted = false;
CreateCitusLocalTable(con->newRelationId, cascade, autoConverted);
/* /*
* creating Citus local table adds a shell table on top * creating Citus local table adds a shell table on top

View File

@ -425,7 +425,10 @@ CreateCitusLocalTablePartitionOf(CreateStmt *createStatement, Oid relationId,
* again with the attach command * again with the attach command
*/ */
DropRelationForeignKeys(relationId, fKeyFlags); DropRelationForeignKeys(relationId, fKeyFlags);
CreateCitusLocalTable(relationId, false, false);
bool cascade = false;
bool autoConverted = false;
CreateCitusLocalTable(relationId, cascade, autoConverted);
ExecuteAndLogUtilityCommand(attachCommand); ExecuteAndLogUtilityCommand(attachCommand);
} }

View File

@ -491,7 +491,9 @@ PreprocessAttachPartitionToCitusTable(Oid parentRelationId, Oid partitionRelatio
* cannot have non-inherited foreign keys. * cannot have non-inherited foreign keys.
*/ */
bool cascadeViaForeignKeys = false; bool cascadeViaForeignKeys = false;
CreateCitusLocalTable(partitionRelationId, cascadeViaForeignKeys, true); bool autoConverted = true;
CreateCitusLocalTable(partitionRelationId, cascadeViaForeignKeys,
autoConverted);
} }
else if (IsCitusTableType(parentRelationId, DISTRIBUTED_TABLE)) else if (IsCitusTableType(parentRelationId, DISTRIBUTED_TABLE))
{ {
@ -1289,7 +1291,8 @@ ConvertPostgresLocalTablesToCitusLocalTables(AlterTableStmt *alterTableStatement
} }
else else
{ {
CreateCitusLocalTable(relationId, cascade, true); bool autoConverted = true;
CreateCitusLocalTable(relationId, cascade, autoConverted);
} }
} }
PG_CATCH(); PG_CATCH();