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

Commitc407d54

Browse files
committed
Add tab completion for ALTER USER/ROLE RESET
Currently tab completion for ALTER USER RESET shows a list of allconfiguration parameters that may be set on a role, irrespectively ofwhich parameters are actually set. This patch improves tab completion tooffer only parameters that are set.Author: Robins TharakanReviewed-By: Tomas VondraDiscussion:https://postgr.es/m/CAEP4nAzqiT6VbVC5r3nq5byLTnPzjniVGzEMpYcnAHQyNzEuaw%40mail.gmail.com
1 parent9df8727 commitc407d54

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1077,6 +1077,11 @@ Keywords_for_list_of_owner_roles, "PUBLIC"
10771077
" FROM pg_catalog.pg_user_mappings "\
10781078
" WHERE usename LIKE '%s'"
10791079

1080+
#defineQuery_for_list_of_user_vars \
1081+
" SELECT pg_catalog.split_part(pg_catalog.unnest(rolconfig),'=',1) "\
1082+
" FROM pg_catalog.pg_roles "\
1083+
" WHERE rolname LIKE '%s'"
1084+
10801085
#defineQuery_for_list_of_access_methods \
10811086
" SELECT amname "\
10821087
" FROM pg_catalog.pg_am "\
@@ -2487,6 +2492,10 @@ match_previous_words(int pattern_id,
24872492
"RENAME TO","REPLICATION","RESET","SET","SUPERUSER",
24882493
"VALID UNTIL","WITH");
24892494

2495+
/* ALTER USER,ROLE <name> RESET */
2496+
elseif (Matches("ALTER","USER|ROLE",MatchAny,"RESET"))
2497+
COMPLETE_WITH_QUERY_PLUS(Query_for_list_of_user_vars,"ALL");
2498+
24902499
/* ALTER USER,ROLE <name> WITH */
24912500
elseif (Matches("ALTER","USER|ROLE",MatchAny,"WITH"))
24922501
/* Similar to the above, but don't complete "WITH" again. */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp