Commit 158e3bc8 authored by Robert Haas's avatar Robert Haas

Tab completion for CREATE SEQUENCE.

Vik Fearing, reviewed by Brendan Jurd, Michael Paquier, and myself
parent a6a23578
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment