diff --git a/src/backend/distributed/commands/create_citus_local_table.c b/src/backend/distributed/commands/create_citus_local_table.c index 691f88890..de8621b14 100644 --- a/src/backend/distributed/commands/create_citus_local_table.c +++ b/src/backend/distributed/commands/create_citus_local_table.c @@ -569,7 +569,7 @@ ExecuteAndLogDDLCommand(const char *commandString) ereport(DEBUG4, (errmsg("executing \"%s\"", commandString))); Node *parseTree = ParseTreeNode(commandString); - CitusProcessUtility(parseTree, commandString, PROCESS_UTILITY_TOPLEVEL, + CitusProcessUtility(parseTree, commandString, PROCESS_UTILITY_QUERY, NULL, None_Receiver, NULL); } diff --git a/src/backend/distributed/commands/create_distributed_table.c b/src/backend/distributed/commands/create_distributed_table.c index a57940aaa..9b9318d76 100644 --- a/src/backend/distributed/commands/create_distributed_table.c +++ b/src/backend/distributed/commands/create_distributed_table.c @@ -1658,7 +1658,7 @@ UndistributeTable(Oid relationId) Node *parseTree = ParseTreeNode(tableCreationCommand); RelayEventExtendNames(parseTree, schemaName, hashOfName); - CitusProcessUtility(parseTree, tableCreationCommand, PROCESS_UTILITY_TOPLEVEL, + CitusProcessUtility(parseTree, tableCreationCommand, PROCESS_UTILITY_QUERY, NULL, None_Receiver, NULL); } diff --git a/src/backend/distributed/executor/local_executor.c b/src/backend/distributed/executor/local_executor.c index cb461fa94..eb1c7afc0 100644 --- a/src/backend/distributed/executor/local_executor.c +++ b/src/backend/distributed/executor/local_executor.c @@ -409,7 +409,8 @@ LocallyExecuteUtilityTask(const char *localTaskQueryCommand) * process utility. */ CitusProcessUtility(localTaskRawParseTree, localTaskQueryCommand, - PROCESS_UTILITY_TOPLEVEL, NULL, None_Receiver, NULL); + PROCESS_UTILITY_QUERY, NULL, None_Receiver, + NULL); } } } diff --git a/src/backend/distributed/utils/role.c b/src/backend/distributed/utils/role.c index 365b6eaa4..7f23d19a1 100644 --- a/src/backend/distributed/utils/role.c +++ b/src/backend/distributed/utils/role.c @@ -41,7 +41,7 @@ alter_role_if_exists(PG_FUNCTION_ARGS) Node *parseTree = ParseTreeNode(utilityQuery); - CitusProcessUtility(parseTree, utilityQuery, PROCESS_UTILITY_TOPLEVEL, NULL, + CitusProcessUtility(parseTree, utilityQuery, PROCESS_UTILITY_QUERY, NULL, None_Receiver, NULL); PG_RETURN_BOOL(true); @@ -98,7 +98,7 @@ worker_create_or_alter_role(PG_FUNCTION_ARGS) CitusProcessUtility(parseTree, createRoleUtilityQuery, - PROCESS_UTILITY_TOPLEVEL, + PROCESS_UTILITY_QUERY, NULL, None_Receiver, NULL); @@ -126,7 +126,7 @@ worker_create_or_alter_role(PG_FUNCTION_ARGS) CitusProcessUtility(parseTree, alterRoleUtilityQuery, - PROCESS_UTILITY_TOPLEVEL, + PROCESS_UTILITY_QUERY, NULL, None_Receiver, NULL); diff --git a/src/backend/distributed/worker/worker_create_or_replace.c b/src/backend/distributed/worker/worker_create_or_replace.c index da8b2f93c..ee4680329 100644 --- a/src/backend/distributed/worker/worker_create_or_replace.c +++ b/src/backend/distributed/worker/worker_create_or_replace.c @@ -111,12 +111,12 @@ worker_create_or_replace_object(PG_FUNCTION_ARGS) RenameStmt *renameStmt = CreateRenameStatement(&address, newName); const char *sqlRenameStmt = DeparseTreeNode((Node *) renameStmt); CitusProcessUtility((Node *) renameStmt, sqlRenameStmt, - PROCESS_UTILITY_TOPLEVEL, + PROCESS_UTILITY_QUERY, NULL, None_Receiver, NULL); } /* apply create statement locally */ - CitusProcessUtility(parseTree, sqlStatement, PROCESS_UTILITY_TOPLEVEL, NULL, + CitusProcessUtility(parseTree, sqlStatement, PROCESS_UTILITY_QUERY, NULL, None_Receiver, NULL); /* type has been created */ diff --git a/src/backend/distributed/worker/worker_data_fetch_protocol.c b/src/backend/distributed/worker/worker_data_fetch_protocol.c index 9c9982a6f..8b006fc5a 100644 --- a/src/backend/distributed/worker/worker_data_fetch_protocol.c +++ b/src/backend/distributed/worker/worker_data_fetch_protocol.c @@ -396,7 +396,7 @@ worker_apply_shard_ddl_command(PG_FUNCTION_ARGS) /* extend names in ddl command and apply extended command */ RelayEventExtendNames(ddlCommandNode, schemaName, shardId); - CitusProcessUtility(ddlCommandNode, ddlCommand, PROCESS_UTILITY_TOPLEVEL, NULL, + CitusProcessUtility(ddlCommandNode, ddlCommand, PROCESS_UTILITY_QUERY, NULL, None_Receiver, NULL); PG_RETURN_VOID(); @@ -428,7 +428,7 @@ worker_apply_inter_shard_ddl_command(PG_FUNCTION_ARGS) RelayEventExtendNamesForInterShardCommands(ddlCommandNode, leftShardId, leftShardSchemaName, rightShardId, rightShardSchemaName); - CitusProcessUtility(ddlCommandNode, ddlCommand, PROCESS_UTILITY_TOPLEVEL, NULL, + CitusProcessUtility(ddlCommandNode, ddlCommand, PROCESS_UTILITY_QUERY, NULL, None_Receiver, NULL); PG_RETURN_VOID(); @@ -461,7 +461,7 @@ worker_apply_sequence_command(PG_FUNCTION_ARGS) } /* run the CREATE SEQUENCE command */ - CitusProcessUtility(commandNode, commandString, PROCESS_UTILITY_TOPLEVEL, NULL, + CitusProcessUtility(commandNode, commandString, PROCESS_UTILITY_QUERY, NULL, None_Receiver, NULL); CommandCounterIncrement(); @@ -669,7 +669,7 @@ worker_append_table_to_shard(PG_FUNCTION_ARGS) SetUserIdAndSecContext(CitusExtensionOwner(), SECURITY_LOCAL_USERID_CHANGE); CitusProcessUtility((Node *) localCopyCommand, queryString->data, - PROCESS_UTILITY_TOPLEVEL, NULL, None_Receiver, NULL); + PROCESS_UTILITY_QUERY, NULL, None_Receiver, NULL); SetUserIdAndSecContext(savedUserId, savedSecurityContext); @@ -782,7 +782,7 @@ AlterSequenceMinMax(Oid sequenceId, char *schemaName, char *sequenceName, /* since the command is an AlterSeqStmt, a dummy command string works fine */ CitusProcessUtility((Node *) alterSequenceStatement, dummyString, - PROCESS_UTILITY_TOPLEVEL, NULL, None_Receiver, NULL); + PROCESS_UTILITY_QUERY, NULL, None_Receiver, NULL); } }