TABLE tab completion

Started by Vik Fearingover 7 years ago3 messages
#1Vik Fearing
vik.fearing@2ndquadrant.com
1 attachment(s)

The tab completion for the TABLE command includes indexes but that's a
bug. Attached is a trivial patch to fix it.
--
Vik Fearing +33 6 46 75 15 36
http://2ndQuadrant.fr PostgreSQL : Expertise, Formation et Support

Attachments:

TABLE_tab-complete.patchtext/x-patch; name=TABLE_tab-complete.patchDownload
diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c
index 7bb47eadc6..787eeb26be 100644
--- a/src/bin/psql/tab-complete.c
+++ b/src/bin/psql/tab-complete.c
@@ -3517,7 +3517,7 @@ psql_completion(const char *text, int start, int end)
 
 /* TABLE, but not TABLE embedded in other commands */
 	else if (Matches1("TABLE"))
-		COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_relations, NULL);
+		COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tsvmf, NULL);
 
 /* TABLESAMPLE */
 	else if (TailMatches1("TABLESAMPLE"))
#2Edmund Horner
ejrh00@gmail.com
In reply to: Vik Fearing (#1)
Re: TABLE tab completion

On 29 May 2018 at 07:28, Vik Fearing <vik.fearing@2ndquadrant.com> wrote:

The tab completion for the TABLE command includes indexes but that's a
bug. Attached is a trivial patch to fix it.

Looks correct to me.

You lose tab completion for "TABLE pg_toast.pg_toast_xyz" but that
seems reasonable. If people want to query toast tables I'm sure
they'll manage.

#3Michael Paquier
michael@paquier.xyz
In reply to: Vik Fearing (#1)
Re: TABLE tab completion

On Mon, May 28, 2018 at 09:28:12PM +0200, Vik Fearing wrote:

The tab completion for the TABLE command includes indexes but that's a
bug. Attached is a trivial patch to fix it.

As far as I can see, this patch is not needed anymore since e3b7a6d1.
--
Michael