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

Commitff9bff0

Browse files
committed
Teach SKIP_LOCKED to psql tab completion of VACUUM and ANALYZE
This was missing since803b130, which has introduced the option for theuser-facing VACUUM and ANALYZE.Author: Masahiko SawadaDiscussion:https://postgr.es/m/CAD21AoD2TMdTxRhZ7WSp940V82_OAyPmgHnbi25UbbArLgA92Q@mail.gmail.com
1 parente988878 commitff9bff0

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

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

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2065,15 +2065,21 @@ psql_completion(const char *text, int start, int end)
20652065
/*
20662066
* ANALYZE [ ( option [, ...] ) ] [ table_and_columns [, ...] ]
20672067
* ANALYZE [ VERBOSE ] [ table_and_columns [, ...] ]
2068-
*
2069-
* Currently the only allowed option is VERBOSE, so we can be skimpier on
2070-
* the option processing than VACUUM has to be.
20712068
*/
20722069
elseif (Matches("ANALYZE"))
20732070
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_analyzables,
20742071
" UNION SELECT 'VERBOSE'");
2075-
elseif (Matches("ANALYZE","("))
2076-
COMPLETE_WITH("VERBOSE)");
2072+
elseif (HeadMatches("ANALYZE","(*")&&
2073+
!HeadMatches("ANALYZE","(*)"))
2074+
{
2075+
/*
2076+
* This fires if we're in an unfinished parenthesized option list.
2077+
* get_previous_words treats a completed parenthesized option list as
2078+
* one word, so the above test is correct.
2079+
*/
2080+
if (ends_with(prev_wd,'(')||ends_with(prev_wd,','))
2081+
COMPLETE_WITH("VERBOSE","SKIP_LOCKED");
2082+
}
20772083
elseif (HeadMatches("ANALYZE")&&TailMatches("("))
20782084
/* "ANALYZE (" should be caught above, so assume we want columns */
20792085
COMPLETE_WITH_ATTR(prev2_wd,"");
@@ -3423,7 +3429,7 @@ psql_completion(const char *text, int start, int end)
34233429
*/
34243430
if (ends_with(prev_wd,'(')||ends_with(prev_wd,','))
34253431
COMPLETE_WITH("FULL","FREEZE","ANALYZE","VERBOSE",
3426-
"DISABLE_PAGE_SKIPPING");
3432+
"DISABLE_PAGE_SKIPPING","SKIP_LOCKED");
34273433
}
34283434
elseif (HeadMatches("VACUUM")&&TailMatches("("))
34293435
/* "VACUUM (" should be caught above, so assume we want columns */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp