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

Commit22b2dec

Browse files
committed
Add CURRENT_ROLE to list of roles for tab completion of GRANT in psql
This compatibility has been added in45b9805, but psql forgot the call.Author: Wei WangReviewed-by: Aleksander AlekseevDiscussion:https://postgr.es/m/OS3PR01MB6275935F62E161BCD393D6559E489@OS3PR01MB6275.jpnprd01.prod.outlook.com
1 parent783be78 commit22b2dec

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -764,6 +764,7 @@ static const SchemaQuery Query_for_list_of_collations = {
764764
" FROM pg_catalog.pg_roles "\
765765
" WHERE substring(pg_catalog.quote_ident(rolname),1,%d)='%s'"\
766766
" UNION ALL SELECT 'PUBLIC'"\
767+
" UNION ALL SELECT 'CURRENT_ROLE'"\
767768
" UNION ALL SELECT 'CURRENT_USER'"\
768769
" UNION ALL SELECT 'SESSION_USER'"
769770

@@ -3450,7 +3451,7 @@ psql_completion(const char *text, int start, int end)
34503451

34513452
/*
34523453
* Complete "GRANT/REVOKE ... TO/FROM" with username, PUBLIC,
3453-
* CURRENT_USER, or SESSION_USER.
3454+
*CURRENT_ROLE,CURRENT_USER, or SESSION_USER.
34543455
*/
34553456
elseif ((HeadMatches("GRANT")&&TailMatches("TO"))||
34563457
(HeadMatches("REVOKE")&&TailMatches("FROM")))
@@ -3884,6 +3885,7 @@ psql_completion(const char *text, int start, int end)
38843885
COMPLETE_WITH("FOR");
38853886
elseif (Matches("CREATE","USER","MAPPING","FOR"))
38863887
COMPLETE_WITH_QUERY(Query_for_list_of_roles
3888+
" UNION SELECT 'CURRENT_ROLE'"
38873889
" UNION SELECT 'CURRENT_USER'"
38883890
" UNION SELECT 'PUBLIC'"
38893891
" UNION SELECT 'USER'");

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp