Rollbacks enable_create_database_propagation

pull/7274/head
gindibay 2023-10-14 20:19:18 +03:00
parent 674fd3226c
commit c6d1ef9e41
2 changed files with 24 additions and 11 deletions

View File

@ -31,40 +31,53 @@ optionToStatement(StringInfo buf, DefElem *option, const struct
{ {
if (strcmp(name, opt_formats[i].name) == 0) if (strcmp(name, opt_formats[i].name) == 0)
{ {
switch (opt_formats[i].type) { switch (opt_formats[i].type)
case OPTION_FORMAT_STRING: { {
case OPTION_FORMAT_STRING:
{
char *value = defGetString(option); char *value = defGetString(option);
appendStringInfo(buf, opt_formats[i].format, quote_identifier(value)); appendStringInfo(buf, opt_formats[i].format, quote_identifier(value));
break; break;
} }
case OPTION_FORMAT_INTEGER: {
case OPTION_FORMAT_INTEGER:
{
int32 value = defGetInt32(option); int32 value = defGetInt32(option);
appendStringInfo(buf, opt_formats[i].format, value); appendStringInfo(buf, opt_formats[i].format, value);
break; break;
} }
case OPTION_FORMAT_BOOLEAN: {
case OPTION_FORMAT_BOOLEAN:
{
bool value = defGetBoolean(option); bool value = defGetBoolean(option);
appendStringInfo(buf, opt_formats[i].format, value ? "true" : "false"); appendStringInfo(buf, opt_formats[i].format, value ? "true" :
"false");
break; break;
} }
#if PG_VERSION_NUM >= PG_VERSION_15 #if PG_VERSION_NUM >= PG_VERSION_15
case OPTION_FORMAT_OBJECT_ID: { case OPTION_FORMAT_OBJECT_ID:
{
Oid value = defGetObjectId(option); Oid value = defGetObjectId(option);
appendStringInfo(buf, opt_formats[i].format, value); appendStringInfo(buf, opt_formats[i].format, value);
break; break;
} }
#endif #endif
case OPTION_FORMAT_LITERAL_CSTR: { case OPTION_FORMAT_LITERAL_CSTR:
{
char *value = defGetString(option); char *value = defGetString(option);
appendStringInfo(buf, opt_formats[i].format, quote_literal_cstr(value)); appendStringInfo(buf, opt_formats[i].format, quote_literal_cstr(
value));
break; break;
} }
default: {
default:
{
elog(ERROR, "unrecognized option type: %d", opt_formats[i].type); elog(ERROR, "unrecognized option type: %d", opt_formats[i].type);
break; break;
} }
} }
break;
} }
} }
} }

View File

@ -1268,7 +1268,7 @@ RegisterCitusConfigVariables(void)
"and DROP DATABASE statements to workers"), "and DROP DATABASE statements to workers"),
NULL, NULL,
&EnableCreateDatabasePropagation, &EnableCreateDatabasePropagation,
true, false,
PGC_USERSET, PGC_USERSET,
GUC_STANDARD, GUC_STANDARD,
NULL, NULL, NULL); NULL, NULL, NULL);