diff options
author | Robert Haas <rhaas@postgresql.org> | 2015-08-04 12:29:20 -0400 |
---|---|---|
committer | Robert Haas <rhaas@postgresql.org> | 2015-08-04 12:29:20 -0400 |
commit | 158e3bc8e2507244b0d1e87ee334f39b7400098a (patch) | |
tree | aad53f809d1704d5f223488918225649edae9dcd /src | |
parent | a6a235782083a98588e41a1298c8fcd89cfaa6b3 (diff) | |
download | postgresql-158e3bc8e2507244b0d1e87ee334f39b7400098a.tar.gz postgresql-158e3bc8e2507244b0d1e87ee334f39b7400098a.zip |
Tab completion for CREATE SEQUENCE.
Vik Fearing, reviewed by Brendan Jurd, Michael Paquier, and myself
Diffstat (limited to 'src')
-rw-r--r-- | src/bin/psql/tab-complete.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c index ece05155490..62cb721cc25 100644 --- a/src/bin/psql/tab-complete.c +++ b/src/bin/psql/tab-complete.c @@ -2467,6 +2467,35 @@ psql_completion(const char *text, int start, int end) pg_strcasecmp(prev_wd, "TO") == 0) COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tables, NULL); +/* CREATE TEMP/TEMPORARY SEQUENCE <name> */ + else if ((pg_strcasecmp(prev3_wd, "CREATE") == 0 && + pg_strcasecmp(prev2_wd, "SEQUENCE") == 0) || + (pg_strcasecmp(prev4_wd, "CREATE") == 0 && + (pg_strcasecmp(prev3_wd, "TEMP") == 0 || + pg_strcasecmp(prev3_wd, "TEMPORARY") == 0) && + pg_strcasecmp(prev2_wd, "SEQUENCE") == 0)) + { + static const char *const list_CREATESEQUENCE[] = + {"INCREMENT BY", "MINVALUE", "MAXVALUE", "NO", "CACHE", + "CYCLE", "OWNED BY", "START WITH", NULL}; + + COMPLETE_WITH_LIST(list_CREATESEQUENCE); + } +/* CREATE TEMP/TEMPORARY SEQUENCE <name> NO */ + else if (((pg_strcasecmp(prev4_wd, "CREATE") == 0 && + pg_strcasecmp(prev3_wd, "SEQUENCE") == 0) || + (pg_strcasecmp(prev5_wd, "CREATE") == 0 && + (pg_strcasecmp(prev4_wd, "TEMP") == 0 || + pg_strcasecmp(prev4_wd, "TEMPORARY") == 0) && + pg_strcasecmp(prev3_wd, "SEQUENCE") == 0)) && + pg_strcasecmp(prev_wd, "NO") == 0) + { + static const char *const list_CREATESEQUENCE2[] = + {"MINVALUE", "MAXVALUE", "CYCLE", NULL}; + + COMPLETE_WITH_LIST(list_CREATESEQUENCE2); + } + /* CREATE SERVER <name> */ else if (pg_strcasecmp(prev3_wd, "CREATE") == 0 && pg_strcasecmp(prev2_wd, "SERVER") == 0) |