mirror of
https://github.com/postgres/postgres.git
synced 2025-05-05 09:19:17 +03:00
Fix tab completion for "ALTER SYSTEM SET variable ...".
It wouldn't complete "TO" after the variable name, which is certainly minor enough. But since we do complete "TO" after "SET variable ...", and since this case used to work pre-9.6, I think this is a bug. Also, fix the query used to collect the variable names; whoever last touched it evidently didn't understand how the pieces are supposed to fit together. It accidentally worked anyway, because readline ignores irrelevant completions, but it was randomly unlike the ones around it, and could be a source of actual bugs if someone copied it as a prototype for another query.
This commit is contained in:
parent
8350aae4f1
commit
a3f4c8e50e
@ -628,9 +628,9 @@ static const SchemaQuery Query_for_list_of_matviews = {
|
|||||||
#define Query_for_list_of_alter_system_set_vars \
|
#define Query_for_list_of_alter_system_set_vars \
|
||||||
"SELECT name FROM "\
|
"SELECT name FROM "\
|
||||||
" (SELECT pg_catalog.lower(name) AS name FROM pg_catalog.pg_settings "\
|
" (SELECT pg_catalog.lower(name) AS name FROM pg_catalog.pg_settings "\
|
||||||
" WHERE context != 'internal') ss "\
|
" WHERE context != 'internal' "\
|
||||||
" WHERE substring(name,1,%d)='%s'"\
|
" UNION ALL SELECT 'all') ss "\
|
||||||
" UNION ALL SELECT 'all' ss"
|
" WHERE substring(name,1,%d)='%s'"
|
||||||
|
|
||||||
#define Query_for_list_of_set_vars \
|
#define Query_for_list_of_set_vars \
|
||||||
"SELECT name FROM "\
|
"SELECT name FROM "\
|
||||||
@ -1572,9 +1572,10 @@ psql_completion(const char *text, int start, int end)
|
|||||||
/* ALTER SYSTEM SET, RESET, RESET ALL */
|
/* ALTER SYSTEM SET, RESET, RESET ALL */
|
||||||
else if (Matches2("ALTER", "SYSTEM"))
|
else if (Matches2("ALTER", "SYSTEM"))
|
||||||
COMPLETE_WITH_LIST2("SET", "RESET");
|
COMPLETE_WITH_LIST2("SET", "RESET");
|
||||||
/* ALTER SYSTEM SET|RESET <name> */
|
|
||||||
else if (Matches3("ALTER", "SYSTEM", "SET|RESET"))
|
else if (Matches3("ALTER", "SYSTEM", "SET|RESET"))
|
||||||
COMPLETE_WITH_QUERY(Query_for_list_of_alter_system_set_vars);
|
COMPLETE_WITH_QUERY(Query_for_list_of_alter_system_set_vars);
|
||||||
|
else if (Matches4("ALTER", "SYSTEM", "SET", MatchAny))
|
||||||
|
COMPLETE_WITH_CONST("TO");
|
||||||
/* ALTER VIEW <name> */
|
/* ALTER VIEW <name> */
|
||||||
else if (Matches3("ALTER", "VIEW", MatchAny))
|
else if (Matches3("ALTER", "VIEW", MatchAny))
|
||||||
COMPLETE_WITH_LIST4("ALTER COLUMN", "OWNER TO", "RENAME TO",
|
COMPLETE_WITH_LIST4("ALTER COLUMN", "OWNER TO", "RENAME TO",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user