Skip to content

Commit d1fcbde

Browse files
committed
Add support for tab-completion of type arguments in \df, \do.
Oversight in commit a3027e1.
1 parent 01add89 commit d1fcbde

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/bin/psql/tab-complete.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3988,6 +3988,8 @@ psql_completion(const char *text, int start, int end)
39883988
COMPLETE_WITH_QUERY(Query_for_list_of_fdws);
39893989
else if (TailMatchesCS("\\df*"))
39903990
COMPLETE_WITH_VERSIONED_SCHEMA_QUERY(Query_for_list_of_functions, NULL);
3991+
else if (HeadMatchesCS("\\df*"))
3992+
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_datatypes, NULL);
39913993

39923994
else if (TailMatchesCS("\\dFd*"))
39933995
COMPLETE_WITH_QUERY(Query_for_list_of_ts_dictionaries);
@@ -4005,6 +4007,9 @@ psql_completion(const char *text, int start, int end)
40054007
COMPLETE_WITH_QUERY(Query_for_list_of_languages);
40064008
else if (TailMatchesCS("\\dn*"))
40074009
COMPLETE_WITH_QUERY(Query_for_list_of_schemas);
4010+
/* no support for completing operators, but we can complete types: */
4011+
else if (HeadMatchesCS("\\do*", MatchAny))
4012+
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_datatypes, NULL);
40084013
else if (TailMatchesCS("\\dp") || TailMatchesCS("\\z"))
40094014
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_grantables, NULL);
40104015
else if (TailMatchesCS("\\dPi*"))

0 commit comments

Comments
 (0)