pgsql: vacuumdb: Fix --analyze-in-stages skipping partitioned tables

From: Fujii Masao <fujii(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: vacuumdb: Fix --analyze-in-stages skipping partitioned tables
Date: 2026-06-03 07:53:58
Message-ID: E1wUgQI-000rsV-2d@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

vacuumdb: Fix --analyze-in-stages skipping partitioned tables

Commit 6429e5b77 changed vacuumdb to process partitioned tables when
--analyze-only or --analyze-in-stages is specified, matching the
documented behavior of analyzing regular tables, partitioned tables,
and materialized views.

Later, commit c4067383cb2 accidentally changed this behavior so that
partitioned tables were processed for --analyze-only, but skipped for
--analyze-in-stages.

As a result, vacuumdb --analyze-in-stages no longer matched its
documentation. Partitioned tables were skipped, leaving parent-table
statistics outdated even though users running vacuumdb
--analyze-in-stages after pg_upgrade, restore, or bulk loading would
expect statistics to be rebuilt for the database.

Fix this issue by making --analyze-in-stages process partitioned
tables again.

Author: Chao Li <lic(at)highgo(dot)com>
Reviewed-by: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Discussion: https://postgr.es/m/EDFF0AFB-050F-4FBF-8D4F-B44DC454D957@gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/95b6ec52e684e5de743e5bf4a2303f6cac466682

Modified Files
--------------
src/bin/scripts/t/100_vacuumdb.pl | 4 ++++
src/bin/scripts/vacuuming.c | 14 ++++++++------
2 files changed, 12 insertions(+), 6 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Dean Rasheed 2026-06-03 08:03:37 pgsql: Improve overflow/underflow handling in regr_r2().
Previous Message Michael Paquier 2026-06-03 03:48:28 pgsql: Fix copy-paste error in hash_record_extended()