Re: pg_stat_get_autovacuum_scores ignores the main table's reloptions for TOAST tables

From: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
To: Nathan Bossart <nathandbossart(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_stat_get_autovacuum_scores ignores the main table's reloptions for TOAST tables
Date: 2026-08-28 18:12:34
Message-ID: CAD21AoC4JF+YdptSLpJSqo8sytMSDiptg0p4i9H2+6PpqA+smg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Aug 28, 2026 at 8:16 AM Nathan Bossart <nathandbossart(at)gmail(dot)com> wrote:
>
> On Fri, Aug 28, 2026 at 10:02:42AM -0500, Nathan Bossart wrote:
> > Here is a patch.
>
> Sorry for the noise. I noticed some silly mistakes in v1, so here's a v2
> with those fixed.

Thank you for making the patch quickly! The patch looks good to me. A nitpick:

+ if (found && hentry->ar_hasrelopts)
+ avopts = &hentry->ar_reloptions;

ar_hasrelopts is always true here, since entries are only created when
extract_autovac_opts() returns non-NULL, so the second conjunct is
redundant actually. Having said that, it seems safer for future
changes and keeping it for symmetry with do_autovacuum() seems fine to
me.

Do we want to have regression tests for it? FWIW no test exercises
pg_stat_get_autovacuum_scores(). The only reference in the tree is the
view definition in rules.out. That's presumably why this went
unnoticed.

Regards,

--
Masahiko Sawada
Amazon Web Services: https://aws.amazon.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2026-08-28 18:31:25 Re: scary patch contest
Previous Message Nick Ivanov 2026-08-28 18:05:43 Re: Possible race condition in pg_basebackup