mirror of https://github.com/citusdata/citus.git
Adds seperate set tablespace on each node support
parent
2d9da93d3d
commit
37d2a5f5a8
|
@ -180,23 +180,16 @@ PreprocessAlterDatabaseStmt(Node *node, const char *queryString,
|
||||||
|
|
||||||
AlterDatabaseStmt *stmt = castNode(AlterDatabaseStmt, node);
|
AlterDatabaseStmt *stmt = castNode(AlterDatabaseStmt, node);
|
||||||
|
|
||||||
EnsureCoordinator();
|
|
||||||
|
|
||||||
char *sql = DeparseTreeNode((Node *) stmt);
|
char *sql = DeparseTreeNode((Node *) stmt);
|
||||||
|
|
||||||
if (strstr(sql, "SELECT pg_catalog.citus_internal_database_command") != NULL) {
|
if (strstr(sql, "SET TABLESPACE") != NULL) {
|
||||||
List *workerNodes = TargetWorkerSetNodeList(NON_COORDINATOR_METADATA_NODES,
|
if (IsCoordinatorNode()){
|
||||||
RowShareLock);
|
ereport(NOTICE, (errmsg("Citus partially supports ALTER DATABASE SET TABLESPACE for "
|
||||||
if (list_length(workerNodes) > 0)
|
"distributed databases"),
|
||||||
{
|
errdetail("Citus does not propagate ALTER DATABASE SET TABLESPACE "
|
||||||
bool outsideTransaction = false;
|
"command to workers"),
|
||||||
|
errhint("You can manually alter a tablespace for a database and its "
|
||||||
List *taskList = CreateDDLTaskList(sql, workerNodes,
|
"extensions on workers.")));
|
||||||
outsideTransaction);
|
|
||||||
|
|
||||||
bool localExecutionSupported = false;
|
|
||||||
ExecuteUtilityTaskList(taskList, localExecutionSupported);
|
|
||||||
return NIL;
|
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
List *commands = list_make3(DISABLE_DDL_PROPAGATION,
|
List *commands = list_make3(DISABLE_DDL_PROPAGATION,
|
||||||
|
|
|
@ -124,8 +124,7 @@ AppendBasicAlterDatabaseOptions(StringInfo buf,DefElem *def, bool prefix_appende
|
||||||
|
|
||||||
static void
|
static void
|
||||||
AppendAlterDatabaseSetTablespace(StringInfo buf,DefElem *def, char *dbname ){
|
AppendAlterDatabaseSetTablespace(StringInfo buf,DefElem *def, char *dbname ){
|
||||||
appendStringInfo(buf,
|
appendStringInfo(buf,"ALTER DATABASE %s SET TABLESPACE %s",
|
||||||
"SELECT pg_catalog.citus_internal_database_command('ALTER DATABASE %s SET TABLESPACE %s')",
|
|
||||||
quote_identifier(dbname),quote_identifier(defGetString(def)));
|
quote_identifier(dbname),quote_identifier(defGetString(def)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue