aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/bin/psql/tab-complete.in.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/bin/psql/tab-complete.in.c b/src/bin/psql/tab-complete.in.c
index 18fecd32807..eb8bc128720 100644
--- a/src/bin/psql/tab-complete.in.c
+++ b/src/bin/psql/tab-complete.in.c
@@ -1077,6 +1077,11 @@ Keywords_for_list_of_owner_roles, "PUBLIC"
" FROM pg_catalog.pg_user_mappings "\
" WHERE usename LIKE '%s'"
+#define Query_for_list_of_user_vars \
+" SELECT pg_catalog.split_part(pg_catalog.unnest(rolconfig),'=',1) "\
+" FROM pg_catalog.pg_roles "\
+" WHERE rolname LIKE '%s'"
+
#define Query_for_list_of_access_methods \
" SELECT amname "\
" FROM pg_catalog.pg_am "\
@@ -2487,6 +2492,10 @@ match_previous_words(int pattern_id,
"RENAME TO", "REPLICATION", "RESET", "SET", "SUPERUSER",
"VALID UNTIL", "WITH");
+ /* ALTER USER,ROLE <name> RESET */
+ else if (Matches("ALTER", "USER|ROLE", MatchAny, "RESET"))
+ COMPLETE_WITH_QUERY_PLUS(Query_for_list_of_user_vars, "ALL");
+
/* ALTER USER,ROLE <name> WITH */
else if (Matches("ALTER", "USER|ROLE", MatchAny, "WITH"))
/* Similar to the above, but don't complete "WITH" again. */