From a3d40e9fb51f8aab9cde5d5018be5e46332275fd Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Thu, 28 Oct 2010 23:05:28 +0300 Subject: [PATCH] Add tab completion for psql \dg and \z Josh Kupershmidt --- src/bin/psql/tab-complete.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c index 00c97d374d..2c368504ec 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); -- 2.11.0