Re: Disabling vacuum truncate for autovacuum

From: Nathan Bossart <nathandbossart(at)gmail(dot)com>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>, Robert Treat <rob(at)xzilla(dot)net>, Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, Gurjeet Singh <gurjeet(at)singh(dot)im>, Andres Freund <andres(at)anarazel(dot)de>, Will Storey <will(at)summercat(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Postgres Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Disabling vacuum truncate for autovacuum
Date: 2025-03-20 21:31:33
Message-ID: Z9yJNZ1C4TJfU-nY@nathan
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

On Thu, Mar 20, 2025 at 02:18:33PM -0700, David G. Johnston wrote:
> So my concern about dump/restore seems to be alleviated but then, why can
> we not just do whatever pg_dump is doing to decide whether the current
> value for vacuum_truncate is its default (and thus would not be dumped) or
> not (and would be dumped)?

pg_dump looks at the pg_class.reloptions array directly. In the vacuum
code, we look at the pre-parsed rd_options (see RelationParseRelOptions()
in relcache.c), which will have already resolved vacuum_truncate to its
default value if it was not explicitly set. We could probably look at
pg_class.reloptions directly in the vacuum code if we _really_ wanted to,
but I felt that putting this information into rd_options was much cleaner.

--
nathan

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2025-03-20 21:56:05 Re: After upgrading libpq, the same function(PQftype) call returns a different OID
Previous Message David G. Johnston 2025-03-20 21:18:33 Re: Disabling vacuum truncate for autovacuum

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2025-03-20 21:31:49 Re: Support "make check" for PGXS extensions
Previous Message Pavel Stehule 2025-03-20 21:30:32 Re: wrong error message related to unsupported feature