Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jMScq-0008J9-IS for pgsql-hackers@arkaria.postgresql.org; Thu, 09 Apr 2020 08:33:28 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jMScp-0000aP-9O for pgsql-hackers@arkaria.postgresql.org; Thu, 09 Apr 2020 08:33:27 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jMScp-0000X5-2A for pgsql-hackers@lists.postgresql.org; Thu, 09 Apr 2020 08:33:27 +0000 Received: from mail-qt1-x835.google.com ([2607:f8b0:4864:20::835]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jMScl-0001tH-QX for pgsql-hackers@postgresql.org; Thu, 09 Apr 2020 08:33:26 +0000 Received: by mail-qt1-x835.google.com with SMTP id n17so2149913qtv.4 for ; Thu, 09 Apr 2020 01:33:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=SSxrD7V2xa8B69VkjydPIC/bt/SPwQL65gECCGUd8AA=; b=AKyPpmCd/M+LgvfWenh5sNKIllVIOJNJNsIDJidEfhQj0P4BZ8tyNk0CXPGlLz9LHl ozFWQ9gFfJlCrevnX2Za+QwhvNvpq+knj/4Y3keZpjaEaR/atw5z5aoWIMUl7q+mh8qI ttKNd7KWyOLHxEM8+HQIEH7qTRrx7XAsh5tZtLCEvEsXyxhs/L3e8M2T0EspKdQVamjJ oOVPn1MvpgjmQ8b/s72qYk5gdPHCpB1MLBWUb6auW88QDNbMG8Yl57/5VhF5o8ROCUkB sH+zYIr0fZAcnxWajEFCyeDhYZTGBbhYeJG2u2TSumhNcRw3+uU6FBis/9RaJKxUinfl jpJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=SSxrD7V2xa8B69VkjydPIC/bt/SPwQL65gECCGUd8AA=; b=Jk76GbkeybldhqWRnxh77+oWVPNP2g1AfbOIiHzpLWsUjvNY/rWZmxj8B6EUJOD5qE nGEWxuWwWXwpz9fAI/KMfYPaEleUcBmFoF/mue6MZGzB2Q5xsnEZ0xA8Tuvn1hvEU65N hj1hXcm2TDTj8qgIqNV377Y6PO5eQvftGGU8llRrWsndjgmB2Hyd+YuvC/hFP6N5yEuX 1V6tuPQP/JhxTc7HCVjLmbOAqQaDpMhq25398baPaBYOjmNaGlTJcW7mu5WFUJV4X3+9 iumLvx/dZ1szBttW4aCS/WKY/79VUOlpJ7iEulTMGPQeZYCxpe73cZXFQ5WAXnZq4CIa tDpg== X-Gm-Message-State: AGi0PuZ+PqLo7d0x6r2qnCao3RANkkPpRluj+HgqnV+UHMj5gvRlafRU 7mcB4Im2DCpuN2++E2JcLlDNeA== X-Google-Smtp-Source: APiQypKCp3WjdUncPNSFH69UznnVrFxLlMlCAELqSYwRmRv0bA+5CFzOK4TXo0Ltf2TfxyWotj0sfQ== X-Received: by 2002:aed:33a6:: with SMTP id v35mr11000423qtd.328.1586421202319; Thu, 09 Apr 2020 01:33:22 -0700 (PDT) Received: from pryzbyj (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id k43sm36611qtk.67.2020.04.09.01.33.20 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Apr 2020 01:33:21 -0700 (PDT) Received: by pryzbyj (Postfix, from userid 1000) id 7C5C6800A33; Thu, 9 Apr 2020 03:33:19 -0500 (CDT) Date: Thu, 9 Apr 2020 03:33:19 -0500 From: Justin Pryzby To: Masahiko Sawada Cc: Amit Kapila , Mahendra Singh Thalor , Robert Haas , tushar , pgsql-hackers@postgresql.org Subject: Re: Vacuum o/p with (full 1, parallel 0) option throwing an error Message-ID: <20200409083319.GN2228@telsasoft.com> References: <20200408164154.GD2228@telsasoft.com> <20200408183854.GG2228@telsasoft.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="YC8Ek3FeOE8ywfXk" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --YC8Ek3FeOE8ywfXk Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Apr 09, 2020 at 05:07:48PM +0900, Masahiko Sawada wrote: > Yes but the difference is that we cannot disable PARSER or COPY by > specifying options whereas we can do something like "VACUUM (FULL > false) tbl" to disable FULL option. I might be misunderstanding the > meaning of "specify" though. You have it right. We should fix the behavior, but change the error message for consistency with that change, like so. -- Justin --YC8Ek3FeOE8ywfXk Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v2-0001-Allow-specifying-parallel-0-with-vacuum-full.patch" From 206d4f2e05360e9d02bcf3b941f9f8ea99f5f8a9 Mon Sep 17 00:00:00 2001 From: Justin Pryzby Date: Thu, 9 Apr 2020 03:29:13 -0500 Subject: [PATCH v2] Allow specifying "(parallel 0)" with "vacuum(full)".. ..even though full implies parallel 0 Discussion: https://www.postgresql.org/message-id/58c8d171-e665-6fa3-a9d3-d9423b694dae%40enterprisedb.com --- src/backend/commands/vacuum.c | 2 +- src/test/regress/expected/vacuum.out | 5 +++-- src/test/regress/sql/vacuum.sql | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/backend/commands/vacuum.c b/src/backend/commands/vacuum.c index 660c854d49..645162d4bd 100644 --- a/src/backend/commands/vacuum.c +++ b/src/backend/commands/vacuum.c @@ -200,7 +200,7 @@ ExecVacuum(ParseState *pstate, VacuumStmt *vacstmt, bool isTopLevel) if ((params.options & VACOPT_FULL) && params.nworkers > 0) ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot specify both FULL and PARALLEL options"))); + errmsg("cannot specify both FULL and parallel workers"))); /* * Make sure VACOPT_ANALYZE is specified if any column lists are present. diff --git a/src/test/regress/expected/vacuum.out b/src/test/regress/expected/vacuum.out index 0cfe28e63f..bc2c3db8d8 100644 --- a/src/test/regress/expected/vacuum.out +++ b/src/test/regress/expected/vacuum.out @@ -115,14 +115,15 @@ LINE 1: VACUUM (PARALLEL -1) pvactst; ^ VACUUM (PARALLEL 2, INDEX_CLEANUP FALSE) pvactst; VACUUM (PARALLEL 2, FULL TRUE) pvactst; -- error, cannot use both PARALLEL and FULL -ERROR: cannot specify both FULL and PARALLEL options +ERROR: cannot specify both FULL and parallel workers +VACUUM (PARALLEL 0, FULL TRUE) pvactst; -- can specify parallel disable (even though that's implied by FULL) VACUUM (PARALLEL) pvactst; -- error, cannot use PARALLEL option without parallel degree ERROR: parallel option requires a value between 0 and 1024 LINE 1: VACUUM (PARALLEL) pvactst; ^ CREATE TEMPORARY TABLE tmp (a int PRIMARY KEY); CREATE INDEX tmp_idx1 ON tmp (a); -VACUUM (PARALLEL 1) tmp; -- disables parallel vacuum option +VACUUM (PARALLEL 1) tmp; -- parallel vacuum disabled for temp tables WARNING: disabling parallel option of vacuum on "tmp" --- cannot vacuum temporary tables in parallel RESET min_parallel_index_scan_size; DROP TABLE pvactst; diff --git a/src/test/regress/sql/vacuum.sql b/src/test/regress/sql/vacuum.sql index cf741f7b11..9743db35c7 100644 --- a/src/test/regress/sql/vacuum.sql +++ b/src/test/regress/sql/vacuum.sql @@ -99,10 +99,11 @@ VACUUM (PARALLEL 0) pvactst; -- disable parallel vacuum VACUUM (PARALLEL -1) pvactst; -- error VACUUM (PARALLEL 2, INDEX_CLEANUP FALSE) pvactst; VACUUM (PARALLEL 2, FULL TRUE) pvactst; -- error, cannot use both PARALLEL and FULL +VACUUM (PARALLEL 0, FULL TRUE) pvactst; -- can specify parallel disable (even though that's implied by FULL) VACUUM (PARALLEL) pvactst; -- error, cannot use PARALLEL option without parallel degree CREATE TEMPORARY TABLE tmp (a int PRIMARY KEY); CREATE INDEX tmp_idx1 ON tmp (a); -VACUUM (PARALLEL 1) tmp; -- disables parallel vacuum option +VACUUM (PARALLEL 1) tmp; -- parallel vacuum disabled for temp tables RESET min_parallel_index_scan_size; DROP TABLE pvactst; -- 2.17.0 --YC8Ek3FeOE8ywfXk--