diff options
author | Amit Kapila <akapila@postgresql.org> | 2020-04-16 10:44:03 +0530 |
---|---|---|
committer | Amit Kapila <akapila@postgresql.org> | 2020-04-16 10:55:02 +0530 |
commit | 24d2d38b1eb86c0b410ad0f07f66566a83c6f05c (patch) | |
tree | a3d35fbbfc7f14e9b65b0f4a44f1acf6776809e8 /src/backend/commands | |
parent | 542d7817f774ea9d94798eb95cdf250d4f1527d9 (diff) | |
download | postgresql-24d2d38b1eb86c0b410ad0f07f66566a83c6f05c.tar.gz postgresql-24d2d38b1eb86c0b410ad0f07f66566a83c6f05c.zip |
Fix the usage of parallel and full options of vacuum command.
Earlier we were inconsistent in allowing the usage of parallel and
full options. Change it such that we disallow them only when they are
combined in a way that we don't support.
In passing, improve the comments in some of the existing tests of parallel
vacuum.
Reported-by: Tushar Ahuja
Author: Justin Pryzby, Amit Kapila
Reviewed-by: Sawada Masahiko, Michael Paquier, Mahendra Singh Thalor and
Amit Kapila
Discussion: https://postgr.es/m/58c8d171-e665-6fa3-a9d3-d9423b694dae%40enterprisedb.com
Diffstat (limited to 'src/backend/commands')
-rw-r--r-- | src/backend/commands/vacuum.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/backend/commands/vacuum.c b/src/backend/commands/vacuum.c index 495ac23a26b..5a110edb072 100644 --- a/src/backend/commands/vacuum.c +++ b/src/backend/commands/vacuum.c @@ -104,7 +104,6 @@ ExecVacuum(ParseState *pstate, VacuumStmt *vacstmt, bool isTopLevel) bool freeze = false; bool full = false; bool disable_page_skipping = false; - bool parallel_option = false; ListCell *lc; /* Set default value */ @@ -145,7 +144,6 @@ ExecVacuum(ParseState *pstate, VacuumStmt *vacstmt, bool isTopLevel) params.truncate = get_vacopt_ternary_value(opt); else if (strcmp(opt->defname, "parallel") == 0) { - parallel_option = true; if (opt->arg == NULL) { ereport(ERROR, @@ -199,10 +197,10 @@ ExecVacuum(ParseState *pstate, VacuumStmt *vacstmt, bool isTopLevel) !(params.options & (VACOPT_FULL | VACOPT_FREEZE))); Assert(!(params.options & VACOPT_SKIPTOAST)); - if ((params.options & VACOPT_FULL) && parallel_option) + if ((params.options & VACOPT_FULL) && params.nworkers > 0) ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot specify both FULL and PARALLEL options"))); + errmsg("VACUUM FULL cannot be performed in parallel"))); /* * Make sure VACOPT_ANALYZE is specified if any column lists are present. |