Re: pgsql: Update guidance for running vacuumdb after pg_upgrade.

Christoph Berg <myon@debian.org>

From: Christoph Berg <myon@debian.org>
To: Nathan Bossart <nathandbossart@gmail.com>
Cc: Corey Huinker <corey.huinker@gmail.com>, pgsql-hackers@lists.postgresql.org
Date: 2025-04-23T14:10:56Z
Lists: pgsql-hackers
Re: Nathan Bossart
>  	pg_log(PG_REPORT,
> +		   "Some statistics are not transferred by pg_upgrade.\n"
>  		   "Once you start the new server, consider running:\n"
> +		   "    %s/vacuumdb %s--all --analyze-in-stages --missing-stats-only\n"
> +		   "    %s/vacuumdb %s--all --analyze-only",

I would make it "Once you start the new server, run these two commands:"
to make it explicit that both should be run, not alternatively either.

This patch addresses my concern, thanks.

Christoph



Commits

  1. Further adjust guidance for running vacuumdb after pg_upgrade.

  2. vacuumdb: Don't skip empty relations in --missing-stats-only mode.

  3. Update guidance for running vacuumdb after pg_upgrade.

  4. Redefine pg_class.reltuples to be -1 before the first VACUUM or ANALYZE.