diff --git a/src/backend/distributed/commands/database.c b/src/backend/distributed/commands/database.c index 762c19c79..70fa871a0 100644 --- a/src/backend/distributed/commands/database.c +++ b/src/backend/distributed/commands/database.c @@ -393,8 +393,6 @@ citus_internal_database_command(PG_FUNCTION_ARGS) if (OidIsValid(databaseOid)) { - /* / * remove database from database shards * / */ - DropDatabase(NULL, (DropdbStmt *) parseTree); } } diff --git a/src/backend/distributed/deparser/citus_deparseutils.c b/src/backend/distributed/deparser/citus_deparseutils.c index 265988b46..1dd8b33bc 100644 --- a/src/backend/distributed/deparser/citus_deparseutils.c +++ b/src/backend/distributed/deparser/citus_deparseutils.c @@ -1,3 +1,4 @@ + #include "postgres.h" #include "utils/builtins.h" #include "commands/defrem.h" @@ -10,9 +11,18 @@ #include "distributed/pg_version_constants.h" +/** + * Convert a DefElem option to a SQL statement and append it to the given StringInfo buffer. + * + * @param buf The StringInfo buffer to append the SQL statement to. + * @param option The DefElem option to convert to a SQL statement. + * @param opt_formats The option format specification to use for the conversion. + * @param num_opt_formats The number of option formats in the opt_formats array. + */ void -handleOption(StringInfo buf, DefElem *option, const struct option_format *opt_formats, int - opt_formats_len) +optionToStatement(StringInfo buf, DefElem *option, const struct + option_format *opt_formats, int + opt_formats_len) { const char *name = option->defname; int i; diff --git a/src/backend/distributed/deparser/deparse_database_stmts.c b/src/backend/distributed/deparser/deparse_database_stmts.c index bc5d48f36..a5a5584af 100644 --- a/src/backend/distributed/deparser/deparse_database_stmts.c +++ b/src/backend/distributed/deparser/deparse_database_stmts.c @@ -237,7 +237,7 @@ AppendCreateDatabaseStmt(StringInfo buf, CreatedbStmt *stmt) foreach_ptr(option, stmt->options) { - handleOption(buf, option, create_database_option_formats, lengthof( + optionToStatement(buf, option, create_database_option_formats, lengthof( create_database_option_formats)); } } diff --git a/src/include/distributed/deparser.h b/src/include/distributed/deparser.h index 428c91a5f..375fd8a8d 100644 --- a/src/include/distributed/deparser.h +++ b/src/include/distributed/deparser.h @@ -131,7 +131,7 @@ struct option_format }; -extern void handleOption(StringInfo buf, DefElem *option, const struct +extern void optionToStatement(StringInfo buf, DefElem *option, const struct option_format *opt_formats, int opt_formats_len);