From 7cffa2ed0c9f7f4d96bac7af5284c47e82af5ffa Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Wed, 8 Sep 2021 13:21:42 -0400 Subject: [PATCH] In psql tab completion, offer spelled-out commands not abbreviations. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/bin/psql/tab-complete.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c index 75b867685a..5cd5838668 100644 --- a/src/bin/psql/tab-complete.c +++ b/src/bin/psql/tab-complete.c @@ -1514,24 +1514,24 @@ psql_completion(const char *text, int start, int end) "\\des", "\\det", "\\deu", "\\dew", "\\dE", "\\df", "\\dF", "\\dFd", "\\dFp", "\\dFt", "\\dg", "\\di", "\\dl", "\\dL", "\\dm", "\\dn", "\\do", "\\dO", "\\dp", "\\dP", "\\dPi", "\\dPt", - "\\drds", "\\dRs", "\\dRp", "\\ds", "\\dS", + "\\drds", "\\dRs", "\\dRp", "\\ds", "\\dt", "\\dT", "\\dv", "\\du", "\\dx", "\\dX", "\\dy", - "\\e", "\\echo", "\\ef", "\\elif", "\\else", "\\encoding", + "\\echo", "\\edit", "\\ef", "\\elif", "\\else", "\\encoding", "\\endif", "\\errverbose", "\\ev", "\\f", "\\g", "\\gdesc", "\\gexec", "\\gset", "\\gx", - "\\h", "\\help", "\\H", - "\\i", "\\if", "\\ir", - "\\l", "\\lo_import", "\\lo_export", "\\lo_list", "\\lo_unlink", - "\\o", - "\\p", "\\password", "\\prompt", "\\pset", - "\\q", "\\qecho", - "\\r", + "\\help", "\\html", + "\\if", "\\include", "\\include_relative", "\\ir", + "\\list", "\\lo_import", "\\lo_export", "\\lo_list", "\\lo_unlink", + "\\out", + "\\password", "\\print", "\\prompt", "\\pset", + "\\qecho", "\\quit", + "\\reset", "\\s", "\\set", "\\setenv", "\\sf", "\\sv", "\\t", "\\T", "\\timing", "\\unset", "\\x", - "\\w", "\\warn", "\\watch", + "\\warn", "\\watch", "\\write", "\\z", "\\!", "\\?", NULL