diff options
author | Neil Conway <neilc@samurai.com> | 2007-04-26 18:10:28 +0000 |
---|---|---|
committer | Neil Conway <neilc@samurai.com> | 2007-04-26 18:10:28 +0000 |
commit | 9475aa917dabe2f53b69d377d686602f6696e5e8 (patch) | |
tree | a4a77848ff67b8ece9908bd554fafab2c6ca73dc | |
parent | c765ca24828c4c25d2bff73bcc061f0ea0e52d53 (diff) | |
download | postgresql-9475aa917dabe2f53b69d377d686602f6696e5e8.tar.gz postgresql-9475aa917dabe2f53b69d377d686602f6696e5e8.zip |
Minor enhancement to psql tab completion. If we see "CREATE TEMPORARY",
we can complete "TABLE". The previous coding only looked for "CREATE TEMP".
Note that I didn't add TEMPORARY to the list of suggested completions
after we've seen "CREATE", since TEMP is equivalent and more concise. But
if the user has already manually typed TEMPORARY, we may as well
complete TABLE for them.
-rw-r--r-- | src/bin/psql/tab-complete.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c index 2ec534cba49..876c3a698c2 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.162 2007/04/26 16:13:13 neilc Exp $ + * $PostgreSQL: pgsql/src/bin/psql/tab-complete.c,v 1.163 2007/04/26 18:10:28 neilc Exp $ */ /*---------------------------------------------------------------------- @@ -1107,9 +1107,10 @@ psql_completion(char *text, int start, int end) COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tables, NULL); /* CREATE TABLE */ - /* Complete CREATE TEMP with "TABLE" */ + /* Complete CREATE TEMP/TEMPORARY with "TABLE" */ else if (pg_strcasecmp(prev2_wd, "CREATE") == 0 && - pg_strcasecmp(prev_wd, "TEMP") == 0) + (pg_strcasecmp(prev_wd, "TEMP") == 0 || + pg_strcasecmp(prev_wd, "TEMPORARY") == 0)) COMPLETE_WITH_CONST("TABLE"); /* CREATE TABLESPACE */ |