Commit 61a956d9 authored by Fujii Masao's avatar Fujii Masao

Improve tab-completion for ALTER MATERIALIZED VIEW.

Author: Takao Fujii
Reviewed-by: Fujii Masao
Discussion: https://postgr.es/m/f9dcdef78c124517edc9e5e5880f651e@oss.nttdata.com
parent 9290ad19
...@@ -1801,9 +1801,22 @@ psql_completion(const char *text, int start, int end) ...@@ -1801,9 +1801,22 @@ psql_completion(const char *text, int start, int end)
"SET SCHEMA"); "SET SCHEMA");
/* ALTER MATERIALIZED VIEW <name> */ /* ALTER MATERIALIZED VIEW <name> */
else if (Matches("ALTER", "MATERIALIZED", "VIEW", MatchAny)) else if (Matches("ALTER", "MATERIALIZED", "VIEW", MatchAny))
COMPLETE_WITH("ALTER COLUMN", "OWNER TO", "RENAME TO", COMPLETE_WITH("ALTER COLUMN", "CLUSTER ON", "DEPENDS ON EXTENSION",
"SET SCHEMA"); "OWNER TO", "RENAME", "RESET (", "SET");
/* ALTER MATERIALIZED VIEW xxx RENAME */
else if (Matches("ALTER", "MATERIALIZED", "VIEW", MatchAny, "RENAME"))
COMPLETE_WITH_ATTR(prev2_wd, " UNION SELECT 'COLUMN' UNION SELECT 'TO'");
else if (Matches("ALTER", "MATERIALIZED", "VIEW", MatchAny, "ALTER|RENAME", "COLUMN"))
COMPLETE_WITH_ATTR(prev3_wd, "");
/* ALTER MATERIALIZED VIEW xxx RENAME yyy */
else if (Matches("ALTER", "MATERIALIZED", "VIEW", MatchAny, "RENAME", MatchAnyExcept("TO")))
COMPLETE_WITH("TO");
/* ALTER MATERIALIZED VIEW xxx RENAME COLUMN yyy */
else if (Matches("ALTER", "MATERIALIZED", "VIEW", MatchAny, "RENAME", "COLUMN", MatchAnyExcept("TO")))
COMPLETE_WITH("TO");
/* ALTER MATERIALIZED VIEW xxx SET */
else if (Matches("ALTER", "MATERIALIZED", "VIEW", MatchAny, "SET"))
COMPLETE_WITH("(", "SCHEMA", "TABLESPACE", "WITHOUT CLUSTER");
/* ALTER POLICY <name> */ /* ALTER POLICY <name> */
else if (Matches("ALTER", "POLICY")) else if (Matches("ALTER", "POLICY"))
COMPLETE_WITH_QUERY(Query_for_list_of_policies); COMPLETE_WITH_QUERY(Query_for_list_of_policies);
......
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