diff --git a/src/backend/distributed/commands/table.c b/src/backend/distributed/commands/table.c index 4187ddff0..0df140175 100644 --- a/src/backend/distributed/commands/table.c +++ b/src/backend/distributed/commands/table.c @@ -1098,13 +1098,12 @@ PreprocessAlterTableSchemaStmt(Node *node, const char *queryString, /* - * WorkerProcessAlterTableStmt checks and processes the alter table statement to be - * worked on the distributed table of the worker node. Currently, it only processes + * SkipForeignKeyValidationIfConstraintIsFkey checks and processes the alter table + * statement to be worked on the distributed table. Currently, it only processes * ALTER TABLE ... ADD FOREIGN KEY command to skip the validation step. */ Node * -WorkerProcessAlterTableStmt(AlterTableStmt *alterTableStatement, - const char *alterTableCommand) +SkipForeignKeyValidationIfConstraintIsFkey(AlterTableStmt *alterTableStatement) { /* first check whether a distributed relation is affected */ if (alterTableStatement->relation == NULL) diff --git a/src/backend/distributed/commands/utility_hook.c b/src/backend/distributed/commands/utility_hook.c index 2290a31f4..84143ad14 100644 --- a/src/backend/distributed/commands/utility_hook.c +++ b/src/backend/distributed/commands/utility_hook.c @@ -416,7 +416,7 @@ multi_ProcessUtility(PlannedStmt *pstmt, * Note validation is done on the shard level when DDL propagation * is enabled. The following eagerly executes some tasks on workers. */ - parsetree = WorkerProcessAlterTableStmt(alterTableStmt, queryString); + parsetree = SkipForeignKeyValidationIfConstraintIsFkey(alterTableStmt); } } } diff --git a/src/include/distributed/commands.h b/src/include/distributed/commands.h index 04f4eef97..50e7c1289 100644 --- a/src/include/distributed/commands.h +++ b/src/include/distributed/commands.h @@ -368,8 +368,7 @@ extern List * PreprocessAlterTableMoveAllStmt(Node *node, const char *queryStrin ProcessUtilityContext processUtilityContext); extern List * PreprocessAlterTableSchemaStmt(Node *node, const char *queryString, ProcessUtilityContext processUtilityContext); -extern Node * WorkerProcessAlterTableStmt(AlterTableStmt *alterTableStatement, - const char *alterTableCommand); +extern Node * SkipForeignKeyValidationIfConstraintIsFkey(AlterTableStmt *alterTableStmt); extern bool IsAlterTableRenameStmt(RenameStmt *renameStmt); extern void ErrorIfAlterDropsPartitionColumn(AlterTableStmt *alterTableStatement); extern void PostprocessAlterTableStmt(AlterTableStmt *pStmt);