mirror of https://github.com/citusdata/citus.git
Removes T_Boolean since it breaks pg14 compile
parent
2b04873159
commit
b99674dcf9
|
@ -20,36 +20,26 @@ handleOption(StringInfo buf, DefElem *option, const struct option_format *opt_fo
|
|||
{
|
||||
if (strcmp(name, opt_formats[i].name) == 0)
|
||||
{
|
||||
switch (opt_formats[i].type)
|
||||
if (strcmp(opt_formats[i].type, "string") == 0)
|
||||
{
|
||||
case T_String:
|
||||
{
|
||||
char *value = defGetString(option);
|
||||
appendStringInfo(buf, opt_formats[i].format, quote_identifier(value));
|
||||
break;
|
||||
}
|
||||
|
||||
case T_Integer:
|
||||
{
|
||||
int32 value = defGetInt32(option);
|
||||
appendStringInfo(buf, opt_formats[i].format, value);
|
||||
break;
|
||||
}
|
||||
|
||||
case T_Boolean:
|
||||
{
|
||||
bool value = defGetBoolean(option);
|
||||
appendStringInfo(buf, opt_formats[i].format, value ? "true" :
|
||||
"false");
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
|
||||
/* Should not happen */
|
||||
elog(ERROR, "unrecognized option type: %d", opt_formats[i].type);
|
||||
char *value = defGetString(option);
|
||||
appendStringInfo(buf, opt_formats[i].format, quote_identifier(value));
|
||||
}
|
||||
return;
|
||||
else if (strcmp(opt_formats[i].type, "integer") == 0)
|
||||
{
|
||||
int32 value = defGetInt32(option);
|
||||
appendStringInfo(buf, opt_formats[i].format, value);
|
||||
}
|
||||
else if (strcmp(opt_formats[i].type, "boolean") == 0)
|
||||
{
|
||||
bool value = defGetBoolean(option);
|
||||
appendStringInfo(buf, opt_formats[i].format, value ? "true" : "false");
|
||||
}
|
||||
else
|
||||
{
|
||||
elog(ERROR, "unrecognized option type: %s", opt_formats[i].type);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -208,18 +208,18 @@ DeparseAlterDatabaseSetStmt(Node *node)
|
|||
|
||||
|
||||
const struct option_format option_formats[] = {
|
||||
{ "template", " TEMPLATE %s", T_String },
|
||||
{ "owner", " OWNER %s", T_String },
|
||||
{ "tablespace", " TABLESPACE %s", T_String },
|
||||
{ "connection_limit", " CONNECTION LIMIT %d", T_Integer },
|
||||
{ "encoding", " ENCODING %s", T_String },
|
||||
{ "lc_collate", " LC_COLLATE %s", T_String },
|
||||
{ "lc_ctype", " LC_CTYPE %s", T_String },
|
||||
{ "icu_locale", " ICU_LOCALE %s", T_String },
|
||||
{ "icu_rules", " ICU_RULES %s", T_String },
|
||||
{ "locale_provider", " LOCALE_PROVIDER %s", T_String },
|
||||
{ "is_template", " IS_TEMPLATE %s", T_Boolean },
|
||||
{ "allow_connections", " ALLOW_CONNECTIONS %s", T_Boolean },
|
||||
{ "template", " TEMPLATE %s", "string" },
|
||||
{ "owner", " OWNER %s", "string" },
|
||||
{ "tablespace", " TABLESPACE %s", "string" },
|
||||
{ "connection_limit", " CONNECTION LIMIT %d", "integer" },
|
||||
{ "encoding", " ENCODING %s", "string" },
|
||||
{ "lc_collate", " LC_COLLATE %s", "string" },
|
||||
{ "lc_ctype", " LC_CTYPE %s", "string" },
|
||||
{ "icu_locale", " ICU_LOCALE %s", "string" },
|
||||
{ "icu_rules", " ICU_RULES %s", "string" },
|
||||
{ "locale_provider", " LOCALE_PROVIDER %s", "string" },
|
||||
{ "is_template", " IS_TEMPLATE %s", "boolean" },
|
||||
{ "allow_connections", " ALLOW_CONNECTIONS %s", "boolean" },
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -127,7 +127,7 @@ struct option_format
|
|||
{
|
||||
const char *name;
|
||||
const char *format;
|
||||
int type;
|
||||
const char *type;
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue