mirror of
https://github.com/postgres/postgres.git
synced 2025-11-09 06:21:09 +03:00
Add MODE option to CHECKPOINT command.
This option may be set to FAST (the default) to request the checkpoint be completed as fast as possible, or SPREAD to request the checkpoint be spread over a longer interval (based on the checkpoint-related configuration parameters). Note that the server may consolidate the options for concurrently requested checkpoints. For example, if one session requests a "fast" checkpoint and another requests a "spread" checkpoint, the server may perform one "fast" checkpoint. Author: Christoph Berg <myon@debian.org> Reviewed-by: Andres Freund <andres@anarazel.de> Reviewed-by: Fujii Masao <masao.fujii@oss.nttdata.com> Reviewed-by: Laurenz Albe <laurenz.albe@cybertec.at> Reviewed-by: Dilip Kumar <dilipbalaut@gmail.com> Discussion: https://postgr.es/m/aDnaKTEf-0dLiEfz%40msg.df7cb.de
This commit is contained in:
@@ -3156,6 +3156,19 @@ match_previous_words(int pattern_id,
|
||||
/* CHECKPOINT */
|
||||
else if (Matches("CHECKPOINT"))
|
||||
COMPLETE_WITH("(");
|
||||
else if (HeadMatches("CHECKPOINT", "(*") &&
|
||||
!HeadMatches("CHECKPOINT", "(*)"))
|
||||
{
|
||||
/*
|
||||
* This fires if we're in an unfinished parenthesized option list.
|
||||
* get_previous_words treats a completed parenthesized option list as
|
||||
* one word, so the above test is correct.
|
||||
*/
|
||||
if (ends_with(prev_wd, '(') || ends_with(prev_wd, ','))
|
||||
COMPLETE_WITH("MODE");
|
||||
else if (TailMatches("MODE"))
|
||||
COMPLETE_WITH("FAST", "SPREAD");
|
||||
}
|
||||
/* CLOSE */
|
||||
else if (Matches("CLOSE"))
|
||||
COMPLETE_WITH_QUERY_PLUS(Query_for_list_of_cursors,
|
||||
|
||||
Reference in New Issue
Block a user