psql: Add some tab completion for TABLESAMPLE.
Petr Jelinek, reviewed by Brendan Jurd
This commit is contained in:
parent
4318118edd
commit
da9ee026a0
@ -737,6 +737,11 @@ static const SchemaQuery Query_for_list_of_matviews = {
|
|||||||
" FROM pg_catalog.pg_event_trigger "\
|
" FROM pg_catalog.pg_event_trigger "\
|
||||||
" WHERE substring(pg_catalog.quote_ident(evtname),1,%d)='%s'"
|
" WHERE substring(pg_catalog.quote_ident(evtname),1,%d)='%s'"
|
||||||
|
|
||||||
|
#define Query_for_list_of_tablesample_methods \
|
||||||
|
" SELECT pg_catalog.quote_ident(tsmname) "\
|
||||||
|
" FROM pg_catalog.pg_tablesample_method "\
|
||||||
|
" WHERE substring(pg_catalog.quote_ident(tsmname),1,%d)='%s'"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This is a list of all "things" in Pgsql, which can show up after CREATE or
|
* This is a list of all "things" in Pgsql, which can show up after CREATE or
|
||||||
* DROP; and there is also a query to get a list of them.
|
* DROP; and there is also a query to get a list of them.
|
||||||
@ -3580,6 +3585,13 @@ psql_completion(const char *text, int start, int end)
|
|||||||
prev2_wd[0] == '\0')
|
prev2_wd[0] == '\0')
|
||||||
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_relations, NULL);
|
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_relations, NULL);
|
||||||
|
|
||||||
|
/* TABLESAMPLE */
|
||||||
|
else if (pg_strcasecmp(prev_wd, "TABLESAMPLE") == 0)
|
||||||
|
COMPLETE_WITH_QUERY(Query_for_list_of_tablesample_methods);
|
||||||
|
|
||||||
|
else if (pg_strcasecmp(prev2_wd, "TABLESAMPLE") == 0)
|
||||||
|
COMPLETE_WITH_CONST("(");
|
||||||
|
|
||||||
/* TRUNCATE */
|
/* TRUNCATE */
|
||||||
else if (pg_strcasecmp(prev_wd, "TRUNCATE") == 0)
|
else if (pg_strcasecmp(prev_wd, "TRUNCATE") == 0)
|
||||||
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tables, NULL);
|
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tables, NULL);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user