Skip to content

Commit a74a5f5

Browse files
committed
Make TABLE tab complation in psql include all relations
Not just tables, since views also work fine with the TABLE command.
1 parent 8140c1b commit a74a5f5

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
@@ -2657,6 +2657,11 @@ psql_completion(char *text, int start, int end)
26572657
else if (pg_strcasecmp(prev_wd, "START") == 0)
26582658
COMPLETE_WITH_CONST("TRANSACTION");
26592659

2660+
/* TABLE, but not TABLE embedded in other commands */
2661+
else if (pg_strcasecmp(prev_wd, "TABLE") == 0 &&
2662+
prev2_wd[0] == '\0')
2663+
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_relations, NULL);
2664+
26602665
/* TRUNCATE */
26612666
else if (pg_strcasecmp(prev_wd, "TRUNCATE") == 0)
26622667
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tables, NULL);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy