Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c878cbe

Browse files
committed
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.
1 parent c962792 commit c878cbe

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/bin/psql/tab-complete.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1553,9 +1553,10 @@ psql_completion(char *text, int start, int end)
15531553
pg_strcasecmp(prev_wd, "ON") == 0)
15541554
{
15551555
static const char *const list_COMMENT[] =
1556-
{"CAST", "COLLATION", "CONVERSION", "DATABASE", "FOREIGN DATA WRAPPER",
1557-
"SERVER", "FOREIGN TABLE", "INDEX", "LANGUAGE", "RULE", "SCHEMA",
1558-
"SEQUENCE", "TABLE", "TYPE", "VIEW", "COLUMN", "AGGREGATE", "FUNCTION",
1556+
{"CAST", "COLLATION", "CONVERSION", "DATABASE", "EXTENSION",
1557+
"FOREIGN DATA WRAPPER", "FOREIGN TABLE",
1558+
"SERVER", "INDEX", "LANGUAGE", "RULE", "SCHEMA", "SEQUENCE",
1559+
"TABLE", "TYPE", "VIEW", "COLUMN", "AGGREGATE", "FUNCTION",
15591560
"OPERATOR", "TRIGGER", "CONSTRAINT", "DOMAIN", "LARGE OBJECT",
15601561
"TABLESPACE", "TEXT SEARCH", "ROLE", NULL};
15611562

@@ -1582,11 +1583,10 @@ psql_completion(char *text, int start, int end)
15821583
}
15831584
else if ((pg_strcasecmp(prev4_wd, "COMMENT") == 0 &&
15841585
pg_strcasecmp(prev3_wd, "ON") == 0) ||
1586+
(pg_strcasecmp(prev5_wd, "COMMENT") == 0 &&
1587+
pg_strcasecmp(prev4_wd, "ON") == 0) ||
15851588
(pg_strcasecmp(prev6_wd, "COMMENT") == 0 &&
1586-
pg_strcasecmp(prev5_wd, "ON") == 0) ||
1587-
(pg_strcasecmp(prev5_wd, "ON") == 0 &&
1588-
pg_strcasecmp(prev4_wd, "TEXT") == 0 &&
1589-
pg_strcasecmp(prev3_wd, "SEARCH") == 0))
1589+
pg_strcasecmp(prev5_wd, "ON") == 0))
15901590
COMPLETE_WITH_CONST("IS");
15911591

15921592
/* COPY */

0 commit comments

Comments
 (0)