Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7307df1

Browse files
committed
Improve tab completion of IMPORT FOREIGN SCHEMA in psql
It is not possible to get a list of foreign schemas as the server is notknown, so this provides instead a list of local schemas, which is moreuseful than nothing if using a loopback server or having schema namesmatching in the local and remote servers.Author: Jeff JanesReviewed-by: Tom Lane, Michael PaquierDiscussion:https://postgr.es/m/CAMkU=1wr7Roj41q-XiJs=Uyc2xCmHhcGGy7J-peJQK-e+w=ghw@mail.gmail.com
1 parentbabef40 commit7307df1

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

‎src/bin/psql/tab-complete.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3293,6 +3293,17 @@ psql_completion(const char *text, int start, int end)
32933293
COMPLETE_WITH("FOREIGN SCHEMA");
32943294
elseif (Matches("IMPORT","FOREIGN"))
32953295
COMPLETE_WITH("SCHEMA");
3296+
elseif (Matches("IMPORT","FOREIGN","SCHEMA",MatchAny))
3297+
COMPLETE_WITH("EXCEPT (","FROM SERVER","LIMIT TO (");
3298+
elseif (TailMatches("LIMIT","TO","(*)")||
3299+
TailMatches("EXCEPT","(*)"))
3300+
COMPLETE_WITH("FROM SERVER");
3301+
elseif (TailMatches("FROM","SERVER",MatchAny))
3302+
COMPLETE_WITH("INTO");
3303+
elseif (TailMatches("FROM","SERVER",MatchAny,"INTO"))
3304+
COMPLETE_WITH_QUERY(Query_for_list_of_schemas);
3305+
elseif (TailMatches("FROM","SERVER",MatchAny,"INTO",MatchAny))
3306+
COMPLETE_WITH("OPTIONS (");
32963307

32973308
/* INSERT --- can be inside EXPLAIN, RULE, etc */
32983309
/* Complete INSERT with "INTO" */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp