Re: pgsql: Move various prechecks from vacuum() into ExecVacuum()

From: David Rowley <dgrowleyml(at)gmail(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: David Rowley <drowley(at)postgresql(dot)org>, pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: Re: pgsql: Move various prechecks from vacuum() into ExecVacuum()
Date: 2023-04-06 04:14:12
Message-ID: CAApHDvpHxPsuWtfjxjxaiuTVTHHRiNKWB3dVUtSr2XDj5B9XhA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

On Thu, 6 Apr 2023 at 16:04, Michael Paquier <michael(at)paquier(dot)xyz> wrote:
> I have just seen this commit, and I am pretty sure that the checks
> have been placed in vacuum() to guard against incorrect option
> manipulations in the context of an autovacuum building the relations,
> so you are making this code weaker with the cross-checks it had, IMO.
> This is particularly relevant in some areas with toast relations, for
> example, because autovacuum handles the toast and their parents
> separately, contrary to ExecVacuum() that would group them together by
> default.

hmm, I'm not sure I agree that would warrant keeping ereport()s in
vacuum(). Autovacuum would have to set either VACOPT_FULL to possibly
trigger the first two moved ereport()s and the final 2 would need
VACOPT_ONLY_DATABASE_STATS. None of those are ever set by auto-vacuum,
so it seems unlikely that some logic somewhere like
relation_needs_vacanalyze().

Asserts() might be a good compromise.

David

In response to

Browse pgsql-committers by date

  From Date Subject
Next Message Etsuro Fujita 2023-04-06 08:37:09 pgsql: postgres_fdw: Add support for parallel abort.
Previous Message Andres Freund 2023-04-06 04:07:51 Re: pgsql: Move various prechecks from vacuum() into ExecVacuum()