Commit c878cbe1 authored by Robert Haas's avatar Robert Haas

Tab completion improvements for COMMENT.

These pertain to object types introduced in PostgreSQL 9.1, so back-patch.

Josh Kupershmidt, with some kibitzing by me.
parent c9627922
...@@ -1553,9 +1553,10 @@ psql_completion(char *text, int start, int end) ...@@ -1553,9 +1553,10 @@ psql_completion(char *text, int start, int end)
pg_strcasecmp(prev_wd, "ON") == 0) pg_strcasecmp(prev_wd, "ON") == 0)
{ {
static const char *const list_COMMENT[] = static const char *const list_COMMENT[] =
{"CAST", "COLLATION", "CONVERSION", "DATABASE", "FOREIGN DATA WRAPPER", {"CAST", "COLLATION", "CONVERSION", "DATABASE", "EXTENSION",
"SERVER", "FOREIGN TABLE", "INDEX", "LANGUAGE", "RULE", "SCHEMA", "FOREIGN DATA WRAPPER", "FOREIGN TABLE",
"SEQUENCE", "TABLE", "TYPE", "VIEW", "COLUMN", "AGGREGATE", "FUNCTION", "SERVER", "INDEX", "LANGUAGE", "RULE", "SCHEMA", "SEQUENCE",
"TABLE", "TYPE", "VIEW", "COLUMN", "AGGREGATE", "FUNCTION",
"OPERATOR", "TRIGGER", "CONSTRAINT", "DOMAIN", "LARGE OBJECT", "OPERATOR", "TRIGGER", "CONSTRAINT", "DOMAIN", "LARGE OBJECT",
"TABLESPACE", "TEXT SEARCH", "ROLE", NULL}; "TABLESPACE", "TEXT SEARCH", "ROLE", NULL};
...@@ -1582,11 +1583,10 @@ psql_completion(char *text, int start, int end) ...@@ -1582,11 +1583,10 @@ psql_completion(char *text, int start, int end)
} }
else if ((pg_strcasecmp(prev4_wd, "COMMENT") == 0 && else if ((pg_strcasecmp(prev4_wd, "COMMENT") == 0 &&
pg_strcasecmp(prev3_wd, "ON") == 0) || pg_strcasecmp(prev3_wd, "ON") == 0) ||
(pg_strcasecmp(prev5_wd, "COMMENT") == 0 &&
pg_strcasecmp(prev4_wd, "ON") == 0) ||
(pg_strcasecmp(prev6_wd, "COMMENT") == 0 && (pg_strcasecmp(prev6_wd, "COMMENT") == 0 &&
pg_strcasecmp(prev5_wd, "ON") == 0) || pg_strcasecmp(prev5_wd, "ON") == 0))
(pg_strcasecmp(prev5_wd, "ON") == 0 &&
pg_strcasecmp(prev4_wd, "TEXT") == 0 &&
pg_strcasecmp(prev3_wd, "SEARCH") == 0))
COMPLETE_WITH_CONST("IS"); COMPLETE_WITH_CONST("IS");
/* COPY */ /* COPY */
......
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