Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/backend/utils/misc/guc_gp.c
Original file line number Diff line number Diff line change
Expand Up @@ -4936,7 +4936,7 @@ struct config_string ConfigureNamesString_gp[] =
{
{"gp_resource_manager", PGC_POSTMASTER, RESOURCES,
gettext_noop("Sets the type of resource manager."),
gettext_noop("Only support \"queue\" and \"group\" for now.")
gettext_noop("Only support \"queue\", \"group\" and \"group-v2\" for now.")
},
&gp_resource_manager_str,
"queue",
Expand Down
26 changes: 16 additions & 10 deletions src/bin/psql/tab-complete.c
Original file line number Diff line number Diff line change
Expand Up @@ -1614,6 +1614,12 @@ psql_completion(const char *text, int start, int end)
NULL
};

static const char *const list_resource_group_type[] = {
"CONCURRENCY", "CPU_MAX_PERCENT", "CPUSET", "CPU_WEIGHT",
"MEMORY_QUOTA", "MIN_COST", "IO_LIMIT",
NULL
};

/*
* Temporary workaround for a bug in recent (2019) libedit: it incorrectly
* de-escapes the input "text", causing us to fail to recognize backslash
Expand Down Expand Up @@ -3115,8 +3121,8 @@ psql_completion(const char *text, int start, int end)
else if (Matches("CREATE", "ROLE|USER|GROUP", MatchAny, "IN"))
COMPLETE_WITH("GROUP", "ROLE");

/* CREATE/DROP RESOURCE GROUP/QUEUE */
else if (Matches("CREATE|DROP", "RESOURCE"))
/* CREATE/DROP/ALTER RESOURCE GROUP/QUEUE */
else if (Matches("CREATE|DROP|ALTER", "RESOURCE"))
{
static const char *const list_CREATERESOURCEGROUP[] =
{"GROUP", "QUEUE", NULL};
Expand All @@ -3130,19 +3136,19 @@ psql_completion(const char *text, int start, int end)
else if (Matches("CREATE", "PROFILE", MatchAny, "LIMIT"))
COMPLETE_WITH("FAILED_LOGIN_ATTEMPTS", "PASSWORD_REUSE_MAX", "PASSWORD_LOCK_TIME");

/* CREATE/DROP RESOURCE GROUP */
else if (TailMatches("CREATE|DROP", "RESOURCE", "GROUP"))
/* CREATE/DROP/ALTER RESOURCE GROUP */
else if (TailMatches("CREATE|DROP|ALTER", "RESOURCE", "GROUP"))
COMPLETE_WITH_QUERY(Query_for_list_of_resgroups);
/* CREATE RESOURCE GROUP <name> */
else if (TailMatches("CREATE|DROP", "RESOURCE", "GROUP", MatchAny))
COMPLETE_WITH("WITH (");
/* ALTER RESOURCE GROUP <name> */
else if (TailMatches("ALTER", "RESOURCE", "GROUP", MatchAny))
COMPLETE_WITH("SET");
else if (TailMatches("ALTER", "RESOURCE", "GROUP", MatchAny, "SET"))
COMPLETE_WITH_LIST(list_resource_group_type);
else if (TailMatches("RESOURCE", "GROUP", MatchAny, "WITH", "("))
{
static const char *const list_CREATERESOURCEGROUP[] =
{"CONCURRENCY", "CPU_MAX_PERCENT", "CPUSET", "CPU_WEIGHT", "MEMORY_QUOTA", "MIN_COST", "IO_LIMIT", NULL};

COMPLETE_WITH_LIST(list_CREATERESOURCEGROUP);
}
COMPLETE_WITH_LIST(list_resource_group_type);

/* CREATE TYPE */
else if (Matches("CREATE", "TYPE", MatchAny))
Expand Down
Loading