On Thu, Mar 06, 2025 at 08:54:59AM +0900, Fujii Masao wrote:
> +1 to having the reloption (if specified) override the GUC setting.
> That is, I think that autovacuum_vacuum_truncate as defining
> the default behavior for VACUUM truncation, and that the GUC should
> only apply when neither the TRUNCATE option in VACUUM nor
> the reloption is set.

One other difference in my version of the patch [0] is to call this GUC
vacuum_truncate and have it apply to both autovacuum and VACUUM.  I did
this for the following reasons:

* There is no autovacuum-specific storage parameter.  There is only
  vacuum_truncate and toast.vacuum_truncate, both of which apply to
  autovacuum and VACUUM.  Unfortunately, adding autovacuum-specific storage
  parameters at this point would break things for folks who are already
  using vacuum_truncate to prevent autovacuum from truncating.  In any
  case, I gather that we try to ordinarily keep storage parameters named
  the same as their corresponding GUCs.

* I'm not sure whether there's a real need to control the autovacuum
  default but not the VACUUM one.  I'd expect most users of this stuff to
  be worried about truncation in both cases, especially for the hot standby
  use-case mentioned upthread.

I should also mention that we just have a few weeks left in the v18
development cycle.  The code itself seems pretty straightforward, so if we
can agree on behavior and nomenclature, I'll do my darndest to get this
responsibly committed in time.

[0] https://postgr.es/m/attachment/172951/v2-0001-Add-vacuum_truncate-GUC.patch

-- 
nathan


Reply via email to