Skip to content

Commit 7cffa2e

Browse files
committed
In psql tab completion, offer spelled-out commands not abbreviations.
Various psql backslash commands have both single-letter and long forms, for example \e and \edit. Previously, tab completion generally offered the single-letter form but not the long form. It seems more sensible to offer the long form, because (a) no useful completion can happen when you've already typed the single letter, and (b) if you're not so familiar with the command set as to know that, the long form is likely to be less confusing. Haiying Tang, reviewed by Dagfinn Ilmari Mannsåker and myself Discussion: https://postgr.es/m/OS0PR01MB61136018064660F095CB57A8FB129@OS0PR01MB6113.jpnprd01.prod.outlook.com
1 parent 362e2dc commit 7cffa2e

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/bin/psql/tab-complete.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1514,24 +1514,24 @@ psql_completion(const char *text, int start, int end)
15141514
"\\des", "\\det", "\\deu", "\\dew", "\\dE", "\\df",
15151515
"\\dF", "\\dFd", "\\dFp", "\\dFt", "\\dg", "\\di", "\\dl", "\\dL",
15161516
"\\dm", "\\dn", "\\do", "\\dO", "\\dp", "\\dP", "\\dPi", "\\dPt",
1517-
"\\drds", "\\dRs", "\\dRp", "\\ds", "\\dS",
1517+
"\\drds", "\\dRs", "\\dRp", "\\ds",
15181518
"\\dt", "\\dT", "\\dv", "\\du", "\\dx", "\\dX", "\\dy",
1519-
"\\e", "\\echo", "\\ef", "\\elif", "\\else", "\\encoding",
1519+
"\\echo", "\\edit", "\\ef", "\\elif", "\\else", "\\encoding",
15201520
"\\endif", "\\errverbose", "\\ev",
15211521
"\\f",
15221522
"\\g", "\\gdesc", "\\gexec", "\\gset", "\\gx",
1523-
"\\h", "\\help", "\\H",
1524-
"\\i", "\\if", "\\ir",
1525-
"\\l", "\\lo_import", "\\lo_export", "\\lo_list", "\\lo_unlink",
1526-
"\\o",
1527-
"\\p", "\\password", "\\prompt", "\\pset",
1528-
"\\q", "\\qecho",
1529-
"\\r",
1523+
"\\help", "\\html",
1524+
"\\if", "\\include", "\\include_relative", "\\ir",
1525+
"\\list", "\\lo_import", "\\lo_export", "\\lo_list", "\\lo_unlink",
1526+
"\\out",
1527+
"\\password", "\\print", "\\prompt", "\\pset",
1528+
"\\qecho", "\\quit",
1529+
"\\reset",
15301530
"\\s", "\\set", "\\setenv", "\\sf", "\\sv",
15311531
"\\t", "\\T", "\\timing",
15321532
"\\unset",
15331533
"\\x",
1534-
"\\w", "\\warn", "\\watch",
1534+
"\\warn", "\\watch", "\\write",
15351535
"\\z",
15361536
"\\!", "\\?",
15371537
NULL

0 commit comments

Comments
 (0)