pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Nathan Bossart <nathandbossart@gmail.com>
To: David G. Johnston <david.g.johnston@gmail.com>
Cc: Fujii Masao <masao.fujii@oss.nttdata.com>
Cc: Robert Treat <rob@xzilla.net>
Cc: Laurenz Albe <laurenz.albe@cybertec.at>
Cc: Gurjeet Singh <gurjeet@singh.im>
Cc: Andres Freund <andres@anarazel.de>
Cc: Will Storey <will@summercat.com>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Postgres Hackers <pgsql-hackers@postgresql.org>
Subject: Re: Disabling vacuum truncate for autovacuum
Date: Thu, 20 Mar 2025 16:31:33 -0500
Message-ID: <Z9yJNZ1C4TJfU-nY@nathan> (raw)
In-Reply-To: <CAKFQuwZJtw7Ojr=Z0xgA0G7BW6qSDkb0fMKgyaQULdOxHg_chA@mail.gmail.com>
References: <CABV9wwNagobmRMCxs0dKqWmKXaQTUQj+oOOTw=fsPAgbBfVhew@mail.gmail.com>
	<Z9g8a4HGLUcSo96v@nathan>
	<Z9ohFZtDaZnkch7u@nathan>
	<88e3b55a-8ef8-4b53-8d71-6bfde1a07bc1@oss.nttdata.com>
	<Z9rlb0jgNLm8ULAB@nathan>
	<Z9rsMX5ZOL5E0cQy@nathan>
	<Z9wxuP1AY303wAxM@nathan>
	<CAKFQuwYKtEUYKS+18gRs-xPhn0qOJgM2KGyyWVCODHuVn9F-XQ@mail.gmail.com>
	<Z9xaroJSrS44HyKG@nathan>
	<CAKFQuwZJtw7Ojr=Z0xgA0G7BW6qSDkb0fMKgyaQULdOxHg_chA@mail.gmail.com>

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





view thread (34+ messages)  latest in thread

Message-ID: <Z9yJNZ1C4TJfU-nY@nathan>
Permalink:  ../Z9yJNZ1C4TJfU-nY@nathan/
Also on:    postgresql.org/message-id/Z9yJNZ1C4TJfU-nY@nathan

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-general@postgresql.org
  Cc: nathandbossart@gmail.com, david.g.johnston@gmail.com, masao.fujii@oss.nttdata.com, rob@xzilla.net, laurenz.albe@cybertec.at, gurjeet@singh.im, andres@anarazel.de, will@summercat.com, robertmhaas@gmail.com, pgsql-hackers@postgresql.org
  Subject: Re: Disabling vacuum truncate for autovacuum
  In-Reply-To: <Z9yJNZ1C4TJfU-nY@nathan>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox