Add tab-completion for CREATE FOREIGN TABLE.

Unlike CREATE TABLE, CREATE FOREIGN TABLE is not allowed inside
CREATE SCHEMA, so Matches() is used instead of TailMatches() for
the tab-completion.

Author: Tang <tanghy.fnst@fujitsu.com>
Reviewed-by: Fujii Masao
Discussion: https://postgr.es/m/OS0PR01MB61137E96E0551278782D11CDFB519@OS0PR01MB6113.jpnprd01.prod.outlook.com
This commit is contained in:
Fujii Masao 2022-01-15 11:22:24 +09:00
parent 36c4bc6e72
commit 74527c3e02
1 changed files with 4 additions and 0 deletions

View File

@ -2636,6 +2636,10 @@ psql_completion(const char *text, int start, int end)
else if (Matches("CREATE", "FOREIGN", "DATA", "WRAPPER", MatchAny))
COMPLETE_WITH("HANDLER", "VALIDATOR", "OPTIONS");
/* CREATE FOREIGN TABLE */
else if (Matches("CREATE", "FOREIGN", "TABLE", MatchAny))
COMPLETE_WITH("(", "PARTITION OF");
/* CREATE INDEX --- is allowed inside CREATE SCHEMA, so use TailMatches */
/* First off we complete CREATE UNIQUE with "INDEX" */
else if (TailMatches("CREATE", "UNIQUE"))