Re: Disabling vacuum truncate for autovacuum - Mailing list pgsql-hackers

From Nathan Bossart
Subject Re: Disabling vacuum truncate for autovacuum
Date
Msg-id Z9yJNZ1C4TJfU-nY@nathan
Whole thread Raw
In response to Re: Disabling vacuum truncate for autovacuum  ("David G. Johnston" <david.g.johnston@gmail.com>)
Responses Re: Disabling vacuum truncate for autovacuum
List 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



pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: wrong error message related to unsupported feature
Next
From: Andrew Dunstan
Date:
Subject: Re: Support "make check" for PGXS extensions