summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Haas2011-06-12 03:52:44 +0000
committerRobert Haas2011-06-12 03:52:44 +0000
commitc878cbe158b6cc20fe5dc65481885f3b2758f432 (patch)
treed1e757b3044d7290862438cd92fa0f8c3d71e75c
parentc9627922115a56cfd1bc966b62108efba581662c (diff)
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.
-rw-r--r--src/bin/psql/tab-complete.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c
index 9a7eca0766..a43d6e3159 100644
--- a/src/bin/psql/tab-complete.c
+++ b/src/bin/psql/tab-complete.c
@@ -1553,9 +1553,10 @@ psql_completion(char *text, int start, int end)
pg_strcasecmp(prev_wd, "ON") == 0)
{
static const char *const list_COMMENT[] =
- {"CAST", "COLLATION", "CONVERSION", "DATABASE", "FOREIGN DATA WRAPPER",
- "SERVER", "FOREIGN TABLE", "INDEX", "LANGUAGE", "RULE", "SCHEMA",
- "SEQUENCE", "TABLE", "TYPE", "VIEW", "COLUMN", "AGGREGATE", "FUNCTION",
+ {"CAST", "COLLATION", "CONVERSION", "DATABASE", "EXTENSION",
+ "FOREIGN DATA WRAPPER", "FOREIGN TABLE",
+ "SERVER", "INDEX", "LANGUAGE", "RULE", "SCHEMA", "SEQUENCE",
+ "TABLE", "TYPE", "VIEW", "COLUMN", "AGGREGATE", "FUNCTION",
"OPERATOR", "TRIGGER", "CONSTRAINT", "DOMAIN", "LARGE OBJECT",
"TABLESPACE", "TEXT SEARCH", "ROLE", NULL};
@@ -1582,11 +1583,10 @@ psql_completion(char *text, int start, int end)
}
else if ((pg_strcasecmp(prev4_wd, "COMMENT") == 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(prev5_wd, "ON") == 0) ||
- (pg_strcasecmp(prev5_wd, "ON") == 0 &&
- pg_strcasecmp(prev4_wd, "TEXT") == 0 &&
- pg_strcasecmp(prev3_wd, "SEARCH") == 0))
+ pg_strcasecmp(prev5_wd, "ON") == 0))
COMPLETE_WITH_CONST("IS");
/* COPY */