aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFujii Masao <fujii@postgresql.org>2022-01-15 11:22:24 +0900
committerFujii Masao <fujii@postgresql.org>2022-01-15 11:22:24 +0900
commit74527c3e022d3ace648340b79a6ddec3419f6732 (patch)
treee2d39f44ff0eb2a218c4afd037d4427cb85a0a91 /src
parent36c4bc6e725fe3e9b5a6cc7f1f83010534f18e4b (diff)
downloadpostgresql-74527c3e022d3ace648340b79a6ddec3419f6732.tar.gz
postgresql-74527c3e022d3ace648340b79a6ddec3419f6732.zip
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
Diffstat (limited to 'src')
-rw-r--r--src/bin/psql/tab-complete.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c
index 39be6f556a8..71f1a5c00d9 100644
--- a/src/bin/psql/tab-complete.c
+++ b/src/bin/psql/tab-complete.c
@@ -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"))