diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c index 00c97d374d3b4bed368631250ad5ec0b3ed9ede4..2c368504ecf368670eece1c9c060ca15f46fcaa3 100644 --- a/src/bin/psql/tab-complete.c +++ b/src/bin/psql/tab-complete.c @@ -2553,7 +2553,8 @@ psql_completion(char *text, int start, int end) COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_indexes, NULL); else if (strncmp(prev_wd, "\\dn", strlen("\\dn")) == 0) COMPLETE_WITH_QUERY(Query_for_list_of_schemas); - else if (strncmp(prev_wd, "\\dp", strlen("\\dp")) == 0) + else if (strncmp(prev_wd, "\\dp", strlen("\\dp")) == 0 + || strncmp(prev_wd, "\\z", strlen("\\z")) == 0) COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tsv, NULL); else if (strncmp(prev_wd, "\\ds", strlen("\\ds")) == 0) COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_sequences, NULL); @@ -2561,7 +2562,8 @@ psql_completion(char *text, int start, int end) COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tables, NULL); else if (strncmp(prev_wd, "\\dT", strlen("\\dT")) == 0) COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_datatypes, NULL); - else if (strncmp(prev_wd, "\\du", strlen("\\du")) == 0) + else if (strncmp(prev_wd, "\\du", strlen("\\du")) == 0 + || (strncmp(prev_wd, "\\dg", strlen("\\dg")) == 0)) COMPLETE_WITH_QUERY(Query_for_list_of_roles); else if (strncmp(prev_wd, "\\dv", strlen("\\dv")) == 0) COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_views, NULL);