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

Commitbf4817e

Browse files
committed
Fix incorrect tab-completion for GRANT and REVOKE
Previously "GRANT * ON * TO " was tab-completed to add an extra "TO",rather than with a list of roles. This is the bug that commit2f88807introduced unexpectedly. This commit fixes that incorrect tab-completion.Thomas Munro, reviewed by Jeff Janes.
1 parent21995d3 commitbf4817e

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3227,15 +3227,6 @@ psql_completion(const char *text, int start, int end)
32273227
COMPLETE_WITH_CONST("FROM");
32283228
}
32293229

3230-
/* Complete "GRANT/REVOKE * ON * *" with TO/FROM */
3231-
elseif (pg_strcasecmp(prev5_wd,"GRANT")==0&&
3232-
pg_strcasecmp(prev3_wd,"ON")==0)
3233-
COMPLETE_WITH_CONST("TO");
3234-
3235-
elseif (pg_strcasecmp(prev5_wd,"REVOKE")==0&&
3236-
pg_strcasecmp(prev3_wd,"ON")==0)
3237-
COMPLETE_WITH_CONST("FROM");
3238-
32393230
/* Complete "GRANT/REVOKE * ON ALL * IN SCHEMA *" with TO/FROM */
32403231
elseif ((pg_strcasecmp(prev8_wd,"GRANT")==0||
32413232
pg_strcasecmp(prev8_wd,"REVOKE")==0)&&
@@ -3295,6 +3286,15 @@ psql_completion(const char *text, int start, int end)
32953286
pg_strcasecmp(prev_wd,"FROM")==0))
32963287
COMPLETE_WITH_QUERY(Query_for_list_of_grant_roles);
32973288

3289+
/* Complete "GRANT/REVOKE * ON * *" with TO/FROM */
3290+
elseif (pg_strcasecmp(prev5_wd,"GRANT")==0&&
3291+
pg_strcasecmp(prev3_wd,"ON")==0)
3292+
COMPLETE_WITH_CONST("TO");
3293+
3294+
elseif (pg_strcasecmp(prev5_wd,"REVOKE")==0&&
3295+
pg_strcasecmp(prev3_wd,"ON")==0)
3296+
COMPLETE_WITH_CONST("FROM");
3297+
32983298
/*
32993299
* Complete "GRANT/REVOKE * TO/FROM" with username, PUBLIC,
33003300
* CURRENT_USER, or SESSION_USER.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp