diff --git a/src/backend/distributed/commands/distribute_object_ops.c b/src/backend/distributed/commands/distribute_object_ops.c index dfa7b0f75..eaf3b2142 100644 --- a/src/backend/distributed/commands/distribute_object_ops.c +++ b/src/backend/distributed/commands/distribute_object_ops.c @@ -23,15 +23,6 @@ static DistributeObjectOps NoDistributeOps = { .address = NULL, }; -static DistributeObjectOps Any_AlterFunction = { - .deparse = DeparseAlterFunctionStmt, - .qualify = QualifyAlterFunctionStmt, - .preprocess = PreprocessAlterFunctionStmt, - .postprocess = NULL, - .address = AlterFunctionStmtObjectAddress, -}; -REGISTER_DISTRIBUTED_OPERATION(AlterFunctionStmt, Any_AlterFunction); - static DistributeObjectOps Any_AlterPolicy = { .deparse = NULL, .qualify = NULL, @@ -68,15 +59,6 @@ static DistributeObjectOps Any_Cluster = { }; REGISTER_DISTRIBUTED_OPERATION(ClusterStmt, Any_Cluster); -static DistributeObjectOps Any_CreateFunction = { - .deparse = NULL, - .qualify = NULL, - .preprocess = PreprocessCreateFunctionStmt, - .postprocess = PostprocessCreateFunctionStmt, - .address = CreateFunctionStmtObjectAddress, -}; -REGISTER_DISTRIBUTED_OPERATION(CreateFunctionStmt, Any_CreateFunction); - static DistributeObjectOps Any_CreatePolicy = { .deparse = NULL, .qualify = NULL, diff --git a/src/backend/distributed/commands/function.c b/src/backend/distributed/commands/function.c index caab71799..9040e9a1d 100644 --- a/src/backend/distributed/commands/function.c +++ b/src/backend/distributed/commands/function.c @@ -88,6 +88,29 @@ static char * quote_qualified_func_name(Oid funcOid); PG_FUNCTION_INFO_V1(create_distributed_function); /* DistributeObjectOps*/ +static List * PreprocessCreateFunctionStmt(Node *node, const char *queryString); +static List * PostprocessCreateFunctionStmt(Node *node, const char *queryString); +static ObjectAddress CreateFunctionStmtObjectAddress(Node *node, bool missing_ok); +static DistributeObjectOps Any_CreateFunction = { + .deparse = NULL, + .qualify = NULL, + .preprocess = PreprocessCreateFunctionStmt, + .postprocess = PostprocessCreateFunctionStmt, + .address = CreateFunctionStmtObjectAddress, +}; +REGISTER_DISTRIBUTED_OPERATION(CreateFunctionStmt, Any_CreateFunction); + +static List * PreprocessAlterFunctionStmt(Node *node, const char *queryString); +static ObjectAddress AlterFunctionStmtObjectAddress(Node *node, bool missing_ok); +static DistributeObjectOps Any_AlterFunction = { + .deparse = DeparseAlterFunctionStmt, + .qualify = QualifyAlterFunctionStmt, + .preprocess = PreprocessAlterFunctionStmt, + .postprocess = NULL, + .address = AlterFunctionStmtObjectAddress, +}; +REGISTER_DISTRIBUTED_OPERATION(AlterFunctionStmt, Any_AlterFunction); + static List * PreprocessAlterFunctionDependsStmt(Node *node, const char *queryString); static ObjectAddress AlterFunctionDependsStmtObjectAddress(Node *node, bool missing_ok); static DistributeObjectOps Function_AlterObjectDepends = { @@ -1250,7 +1273,7 @@ ShouldPropagateAlterFunction(const ObjectAddress *address) * Instead we do our basic housekeeping where we make sure we are on the coordinator and * can propagate the function in sequential mode. */ -List * +static List * PreprocessCreateFunctionStmt(Node *node, const char *queryString) { CreateFunctionStmt *stmt = castNode(CreateFunctionStmt, node); @@ -1279,7 +1302,7 @@ PreprocessCreateFunctionStmt(Node *node, const char *queryString) * Besides creating the plan we also make sure all (new) dependencies of the function are * created on all nodes. */ -List * +static List * PostprocessCreateFunctionStmt(Node *node, const char *queryString) { CreateFunctionStmt *stmt = castNode(CreateFunctionStmt, node); @@ -1306,7 +1329,7 @@ PostprocessCreateFunctionStmt(Node *node, const char *queryString) * CREATE [OR REPLACE] FUNCTION statement. If missing_ok is false it will error with the * normal postgres error for unfound functions. */ -ObjectAddress +static ObjectAddress CreateFunctionStmtObjectAddress(Node *node, bool missing_ok) { CreateFunctionStmt *stmt = castNode(CreateFunctionStmt, node); @@ -1364,7 +1387,7 @@ DefineAggregateStmtObjectAddress(Node *node, bool missing_ok) * plan the jobs to be executed on the workers for functions that have been distributed in * the cluster. */ -List * +static List * PreprocessAlterFunctionStmt(Node *node, const char *queryString) { AlterFunctionStmt *stmt = castNode(AlterFunctionStmt, node); @@ -1690,7 +1713,7 @@ PostprocessAlterFunctionSchemaStmt(Node *node, const char *queryString) * AlterFunctionStmt. If missing_ok is set to false an error will be raised if postgres * was unable to find the function/procedure that was the target of the statement. */ -ObjectAddress +static ObjectAddress AlterFunctionStmtObjectAddress(Node *node, bool missing_ok) { AlterFunctionStmt *stmt = castNode(AlterFunctionStmt, node); diff --git a/src/include/distributed/commands.h b/src/include/distributed/commands.h index 8a0ed4a8a..56a152b26 100644 --- a/src/include/distributed/commands.h +++ b/src/include/distributed/commands.h @@ -167,16 +167,6 @@ extern bool TableReferencing(Oid relationId); extern bool ConstraintIsAForeignKey(char *constraintName, Oid relationId); -/* function.c - forward declarations */ -extern List * PreprocessCreateFunctionStmt(Node *stmt, const char *queryString); -extern List * PostprocessCreateFunctionStmt(Node *stmt, - const char *queryString); -extern ObjectAddress CreateFunctionStmtObjectAddress(Node *stmt, - bool missing_ok); -extern List * PreprocessAlterFunctionStmt(Node *stmt, const char *queryString); -extern ObjectAddress AlterFunctionStmtObjectAddress(Node *stmt, - bool missing_ok); - /* index.c - forward declarations */ extern bool IsIndexRenameStmt(RenameStmt *renameStmt); extern List * PreprocessIndexStmt(Node *createIndexStatement,