Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita5d4e3f

Browse files
committed
Fix tab completion for "ALTER SYSTEM SET variable ...".
It wouldn't complete "TO" after the variable name, which is certainlyminor 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 lasttouched it evidently didn't understand how the pieces are supposedto fit together. It accidentally worked anyway, because readlineignores irrelevant completions, but it was randomly unlike the onesaround it, and could be a source of actual bugs if someone copiedit as a prototype for another query.
1 parent01e0cbc commita5d4e3f

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

‎src/bin/psql/tab-complete.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -675,9 +675,9 @@ static const SchemaQuery Query_for_list_of_matviews = {
675675
#defineQuery_for_list_of_alter_system_set_vars \
676676
"SELECT name FROM "\
677677
" (SELECT pg_catalog.lower(name) AS name FROM pg_catalog.pg_settings "\
678-
" WHERE context != 'internal') ss "\
679-
"WHERE substring(name,1,%d)='%s'"\
680-
"UNION ALL SELECT 'all' ss"
678+
" WHERE context != 'internal' "\
679+
" UNION ALL SELECT 'all') ss"\
680+
"WHERE substring(name,1,%d)='%s'"
681681

682682
#defineQuery_for_list_of_set_vars \
683683
"SELECT name FROM "\
@@ -1661,9 +1661,10 @@ psql_completion(const char *text, int start, int end)
16611661
/* ALTER SYSTEM SET, RESET, RESET ALL */
16621662
elseif (Matches2("ALTER","SYSTEM"))
16631663
COMPLETE_WITH_LIST2("SET","RESET");
1664-
/* ALTER SYSTEM SET|RESET <name> */
16651664
elseif (Matches3("ALTER","SYSTEM","SET|RESET"))
16661665
COMPLETE_WITH_QUERY(Query_for_list_of_alter_system_set_vars);
1666+
elseif (Matches4("ALTER","SYSTEM","SET",MatchAny))
1667+
COMPLETE_WITH_CONST("TO");
16671668
/* ALTER VIEW <name> */
16681669
elseif (Matches3("ALTER","VIEW",MatchAny))
16691670
COMPLETE_WITH_LIST4("ALTER COLUMN","OWNER TO","RENAME TO",

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp