projects
/
users
/
hanada
/
postgres.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8140c1b
)
Make TABLE tab complation in psql include all relations
author
Magnus Hagander
<magnus@hagander.net>
Mon, 24 Oct 2011 11:22:59 +0000
(13:22 +0200)
committer
Magnus Hagander
<magnus@hagander.net>
Mon, 24 Oct 2011 11:22:59 +0000
(13:22 +0200)
Not just tables, since views also work fine with the
TABLE command.
src/bin/psql/tab-complete.c
patch
|
blob
|
blame
|
history
diff --git
a/src/bin/psql/tab-complete.c
b/src/bin/psql/tab-complete.c
index aba9b4b5aac597ff20b1ce428a8d42401ffd32e3..bb0fa09f3eaefb3d47d03da48724598cbc96595d 100644
(file)
--- a/
src/bin/psql/tab-complete.c
+++ b/
src/bin/psql/tab-complete.c
@@
-2657,6
+2657,11
@@
psql_completion(char *text, int start, int end)
else if (pg_strcasecmp(prev_wd, "START") == 0)
COMPLETE_WITH_CONST("TRANSACTION");
+/* TABLE, but not TABLE embedded in other commands */
+ else if (pg_strcasecmp(prev_wd, "TABLE") == 0 &&
+ prev2_wd[0] == '\0')
+ COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_relations, NULL);
+
/* TRUNCATE */
else if (pg_strcasecmp(prev_wd, "TRUNCATE") == 0)
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tables, NULL);