From: Peter Eisentraut <peter_e@gmx.net>
Date: Tue, 14 Jun 2011 20:45:00 +0000 (+0300)
Subject: Allow psql \d tab completion to complete all relation kinds
X-Git-Tag: REL9_2_BETA1~1562
X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=707195c8f487a39c34ea4d965140465594eb5c21;p=postgresql

Allow psql \d tab completion to complete all relation kinds

This matches what \d actually accepts.
---

diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c
index a43d6e3159..32f418306c 100644
--- a/src/bin/psql/tab-complete.c
+++ b/src/bin/psql/tab-complete.c
@@ -369,11 +369,11 @@ static const SchemaQuery Query_for_list_of_updatables = {
 	NULL
 };
 
-static const SchemaQuery Query_for_list_of_tisvf = {
+static const SchemaQuery Query_for_list_of_relations = {
 	/* catname */
 	"pg_catalog.pg_class c",
 	/* selcondition */
-	"c.relkind IN ('r', 'i', 'S', 'v', 'f')",
+	NULL,
 	/* viscondition */
 	"pg_catalog.pg_table_is_visible(c.oid)",
 	/* namespace */
@@ -2826,7 +2826,7 @@ psql_completion(char *text, int start, int end)
 
 	/* must be at end of \d list */
 	else if (strncmp(prev_wd, "\\d", strlen("\\d")) == 0)
-		COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tisvf, NULL);
+		COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_relations, NULL);
 
 	else if (strcmp(prev_wd, "\\ef") == 0)
 		COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_functions, NULL);