Re: Vacuum o/p with (full 1, parallel 0) option throwing an error

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: Masahiko Sawada <masahiko(dot)sawada(at)2ndquadrant(dot)com>, Justin Pryzby <pryzby(at)telsasoft(dot)com>, Mahendra Singh Thalor <mahi6run(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, tushar <tushar(dot)ahuja(at)enterprisedb(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Vacuum o/p with (full 1, parallel 0) option throwing an error
Date: 2020-04-14 02:22:42
Message-ID: 20200414022242.GG1492@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Apr 13, 2020 at 05:55:43PM +0530, Amit Kapila wrote:
> On Mon, Apr 13, 2020 at 4:23 PM Masahiko Sawada
> <masahiko(dot)sawada(at)2ndquadrant(dot)com> wrote:
> I am not very sure about this. I don't think the current text is wrong
> especially when you see the value we can specify there is described
> as: "Specifies a non-negative integer value passed to the selected
> option.". However, we can consider changing it if others also think
> the proposed text or something like that is better than current text.

FWIW, the current formulation in the docs looked fine to me.

> Yeah, something on these lines would be a good idea. Note that, we are
> already planning to slightly change this particular sentence in
> another patch [1].
>
> [1] - https://www.postgresql.org/message-id/20200322021801.GB2563%40telsasoft.com

Makes sense. I have two comments.

ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot specify both FULL and PARALLEL options")));
+ errmsg("VACUUM FULL cannot be performed in parallel")));
Better to avoid a full sentence here [1]? This should be a "cannot do
foo" errror.

-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
+VACUUM (PARALLEL 0, FULL TRUE) tmp; -- can specify parallel disabled (even though that's implied by FULL)

To fully close the gap in the tests, I would also add a test for
(PARALLEL 1, FULL false) where FULL directly specified, even if that
sounds like a nit. That's fine to test even on a temporary table.

[1]: https://www.postgresql.org/docs/devel/error-style-guide.html
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Lin, Cuiping 2020-04-14 02:32:40 Should program exit, When close() failed for O_RDONLY mode
Previous Message Michael Paquier 2020-04-14 01:57:06 Re: relcache leak warnings vs. errors