From 5b9d81b156d773eab433f455c1711b4ea70c0486 Mon Sep 17 00:00:00 2001 From: Neil Conway Date: Thu, 26 Apr 2007 22:25:56 +0000 Subject: [PATCH] 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. --- src/bin/psql/tab-complete.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c index 612702ffad..06ba257cfd 100644 --- a/src/bin/psql/tab-complete.c +++ b/src/bin/psql/tab-complete.c @@ -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 && -- 2.39.5