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

From: Nathan Bossart <nathandbossart(at)gmail(dot)com>
To: Masahiko Sawada <sawada(dot)mshk(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 13:14:17
Message-ID: apGJqfd2xyAcUGKZ@nathan
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Aug 27, 2026 at 03:42:23PM -0700, Masahiko Sawada wrote:
> I found that pg_get_autovacuum_scores reports wrong values for TOAST
> tables. In do_autovacuum(), we fall back to the main table's reloption
> when the TOAST table has no reloptions of its own, and
> table_recheck_autovac() does the same. However,
> pg_stat_get_autovacuum_scores() only calls extract_autovac_opts() and
> passes NULL when the TOAST table has none.
>
> So the view computes the TOAST table's scores from rht eGUC defaults
> whenever the user sets autovacuum_* on the main table without setting
> the corresponding toast.* option. Here is a simple reproducer:

You're right. I will work on a patch for this and get it fixed ASAP.

--
nathan

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Karina Litskevich 2026-08-28 13:18:29 Re: Function scan FDW pushdown
Previous Message Andrey Borodin 2026-08-28 13:00:58 Open SSI correctness issues