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

Commit6b40d9b

Browse files
committed
Improve tab-completion for TRUNCATE.
Author: Kota MiyakeReviewed-by: Muhammad UsamaDiscussion:https://postgr.es/m/f5d30053d00dcafda3280c9e267ecb0f@oss.nttdata.com
1 parenta6f8dc4 commit6b40d9b

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3832,7 +3832,20 @@ psql_completion(const char *text, int start, int end)
38323832

38333833
/* TRUNCATE */
38343834
elseif (Matches("TRUNCATE"))
3835+
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tables,
3836+
" UNION SELECT 'TABLE'"
3837+
" UNION SELECT 'ONLY'");
3838+
elseif (Matches("TRUNCATE","TABLE"))
3839+
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tables,
3840+
" UNION SELECT 'ONLY'");
3841+
elseif (HeadMatches("TRUNCATE")&&TailMatches("ONLY"))
38353842
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tables,NULL);
3843+
elseif (Matches("TRUNCATE",MatchAny)||
3844+
Matches("TRUNCATE","TABLE|ONLY",MatchAny)||
3845+
Matches("TRUNCATE","TABLE","ONLY",MatchAny))
3846+
COMPLETE_WITH("RESTART IDENTITY","CONTINUE IDENTITY","CASCADE","RESTRICT");
3847+
elseif (HeadMatches("TRUNCATE")&&TailMatches("IDENTITY"))
3848+
COMPLETE_WITH("CASCADE","RESTRICT");
38363849

38373850
/* UNLISTEN */
38383851
elseif (Matches("UNLISTEN"))

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp