Skip to content

Commit a3d40e9

Browse files
committed
Add tab completion for psql \dg and \z
Josh Kupershmidt
1 parent 299591d commit a3d40e9

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/bin/psql/tab-complete.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2553,15 +2553,17 @@ psql_completion(char *text, int start, int end)
25532553
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_indexes, NULL);
25542554
else if (strncmp(prev_wd, "\\dn", strlen("\\dn")) == 0)
25552555
COMPLETE_WITH_QUERY(Query_for_list_of_schemas);
2556-
else if (strncmp(prev_wd, "\\dp", strlen("\\dp")) == 0)
2556+
else if (strncmp(prev_wd, "\\dp", strlen("\\dp")) == 0
2557+
|| strncmp(prev_wd, "\\z", strlen("\\z")) == 0)
25572558
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tsv, NULL);
25582559
else if (strncmp(prev_wd, "\\ds", strlen("\\ds")) == 0)
25592560
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_sequences, NULL);
25602561
else if (strncmp(prev_wd, "\\dt", strlen("\\dt")) == 0)
25612562
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tables, NULL);
25622563
else if (strncmp(prev_wd, "\\dT", strlen("\\dT")) == 0)
25632564
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_datatypes, NULL);
2564-
else if (strncmp(prev_wd, "\\du", strlen("\\du")) == 0)
2565+
else if (strncmp(prev_wd, "\\du", strlen("\\du")) == 0
2566+
|| (strncmp(prev_wd, "\\dg", strlen("\\dg")) == 0))
25652567
COMPLETE_WITH_QUERY(Query_for_list_of_roles);
25662568
else if (strncmp(prev_wd, "\\dv", strlen("\\dv")) == 0)
25672569
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_views, NULL);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy