diff --git a/src/backend/distributed/deparser/deparse_database_stmts.c b/src/backend/distributed/deparser/deparse_database_stmts.c index 3383d2954..2c1dc0b66 100644 --- a/src/backend/distributed/deparser/deparse_database_stmts.c +++ b/src/backend/distributed/deparser/deparse_database_stmts.c @@ -259,7 +259,7 @@ DeparseAlterDatabaseSetStmt(Node *node) static void ValidateCreateDatabaseOptions(DefElem *option) { - if (strcmp(option->defname, "strategy") == 0 || strcmp(option->defname, "oid") == 0) + if (strcmp(option->defname, "oid") == 0) { ereport(ERROR, errmsg("CREATE DATABASE option \"%s\" is not supported", @@ -267,11 +267,18 @@ ValidateCreateDatabaseOptions(DefElem *option) } char *optionValue = defGetString(option); + if (strcmp(option->defname, "template") == 0 && strcmp(optionValue, "template1") != 0) { - ereport(ERROR, errmsg( - "Only template1 is supported as template parameter for CREATE DATABASE")); + ereport(ERROR, errmsg("Only template1 is supported as template " + "parameter for CREATE DATABASE")); } + + if (strcmp(option->defname, "strategy") == 0 && strcmp(optionValue, "wal_log") != 0) + { + ereport(ERROR, errmsg("Only wal_log is supported as strategy " + "parameter for CREATE DATABASE")); + } } diff --git a/src/include/distributed/commands.h b/src/include/distributed/commands.h index 85c55d39a..4c47d3ecd 100644 --- a/src/include/distributed/commands.h +++ b/src/include/distributed/commands.h @@ -239,9 +239,9 @@ extern List * PreprocessCreateDatabaseStmt(Node *node, const char *queryString, extern List * PostprocessCreateDatabaseStmt(Node *node, const char *queryString); extern List * PreprocessDropDatabaseStmt(Node *node, const char *queryString, ProcessUtilityContext processUtilityContext); -extern List * DropDatabaseStmtObjectAddress(Node *node, bool missing_ok, +extern List * DropDatabaseStmtObjectAddress(Node *node, bool missingOk, bool isPostprocess); -extern List * CreateDatabaseStmtObjectAddress(Node *node, bool missing_ok, +extern List * CreateDatabaseStmtObjectAddress(Node *node, bool missingOk, bool isPostprocess); extern List * GenerateCreateDatabaseCommandList(void);