Add tab completion for psql \dg and \z

Josh Kupershmidt
This commit is contained in:
Peter Eisentraut 2010-10-28 23:05:28 +03:00
parent 299591d1a2
commit a3d40e9fb5
1 changed files with 4 additions and 2 deletions

View File

@ -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);