While reviewing the seqam patches, I noticed that psql has tab
completion for ALTER SEQUENCE, but not for CREATE SEQUENCE.
The attached trivial patch fixes that.
--
Vik Fearing +33 6 46 75 15 36
http://2ndQuadrant.fr PostgreSQL : Expertise, Formation et Support
*** a/src/bin/psql/tab-complete.c
--- b/src/bin/psql/tab-complete.c
***************
*** 2445,2450 **** psql_completion(const char *text, int start, int end)
--- 2445,2471 ----
pg_strcasecmp(prev_wd, "TO") == 0)
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tables, NULL);
+ /* CREATE SEQUENCE <name> */
+ else if (pg_strcasecmp(prev3_wd, "CREATE") == 0 &&
+ pg_strcasecmp(prev2_wd, "SEQUENCE") == 0)
+ {
+ static const char *const list_CREATESEQUENCE[] =
+ {"INCREMENT", "MINVALUE", "MAXVALUE", "RESTART", "NO", "CACHE", "CYCLE",
+ "SET SCHEMA", "OWNED BY", "OWNER TO", "RENAME TO", NULL};
+
+ COMPLETE_WITH_LIST(list_CREATESEQUENCE);
+ }
+ /* CREATE SEQUENCE <name> NO */
+ else if (pg_strcasecmp(prev4_wd, "CREATE") == 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)
--
Sent via pgsql-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers