aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNeil Conway <neilc@samurai.com>2007-04-26 22:25:56 +0000
committerNeil Conway <neilc@samurai.com>2007-04-26 22:25:56 +0000
commit8e90c5448018b5e7c57f81e1aeea22ffff7567ef (patch)
tree118e5345da39be598bcfb48392e85ffa4ec2a8ec /src
parent16fb5da730d0976208b69df5f6b574df5a91923a (diff)
downloadpostgresql-8e90c5448018b5e7c57f81e1aeea22ffff7567ef.tar.gz
postgresql-8e90c5448018b5e7c57f81e1aeea22ffff7567ef.zip
Another tweak for tab completion of CREATE TEMP. Instead of only
completing CREATE { TEMP | TEMPORARY } TABLE, we should also suggest VIEW and SEQUENCE. Per Greg Sabino Mullane.
Diffstat (limited to 'src')
-rw-r--r--src/bin/psql/tab-complete.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c
index 876c3a698c2..d9f6f49bbba 100644
--- a/src/bin/psql/tab-complete.c
+++ b/src/bin/psql/tab-complete.c
@@ -3,7 +3,7 @@
*
* Copyright (c) 2000-2007, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/bin/psql/tab-complete.c,v 1.163 2007/04/26 18:10:28 neilc Exp $
+ * $PostgreSQL: pgsql/src/bin/psql/tab-complete.c,v 1.164 2007/04/26 22:25:56 neilc Exp $
*/
/*----------------------------------------------------------------------
@@ -1107,11 +1107,16 @@ psql_completion(char *text, int start, int end)
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tables, NULL);
/* CREATE TABLE */
- /* Complete CREATE TEMP/TEMPORARY with "TABLE" */
+ /* Complete "CREATE TEMP/TEMPORARY" with the possible temp objects */
else if (pg_strcasecmp(prev2_wd, "CREATE") == 0 &&
(pg_strcasecmp(prev_wd, "TEMP") == 0 ||
pg_strcasecmp(prev_wd, "TEMPORARY") == 0))
- COMPLETE_WITH_CONST("TABLE");
+ {
+ static const char *const list_TEMP[] =
+ { "SEQUENCE", "TABLE", "VIEW", NULL };
+
+ COMPLETE_WITH_LIST(list_TEMP);
+ }
/* CREATE TABLESPACE */
else if (pg_strcasecmp(prev3_wd, "CREATE") == 0 &&