[PATCH] Doc: clarify that pg_upgrade statistics transfer works cross-version

From: nik(at)postgres(dot)ai
To: pgsql-docs(at)lists(dot)postgresql(dot)org
Subject: [PATCH] Doc: clarify that pg_upgrade statistics transfer works cross-version
Date: 2026-03-24 03:30:57
Message-ID: CAM527d_Qt9ZGt99vgTaidfObRiDH0R5F_uEfum9zHeZbc+LwCQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-docs

Hi hackers,

I initially assumed that PG18's statistics transfer during pg_upgrade
would only work when upgrading from PG18 to a future version. I hear
this misconception from others fairly often too.

In reality, it works when upgrading *to* PG18 from any older supported
version (PG14, 15, 16, 17), because pg_upgrade uses the new cluster's
pg_dump, which reads from standard catalog views (pg_class and
pg_stats) that exist in all PostgreSQL versions. The pg_dump docs
already note that "pg_dump can also dump from PostgreSQL servers older
than its own version" — so no changes needed there. The confusion
seems specific to the major upgrade context.

The attached patch adds a brief clarification to pgupgrade.sgml to address this.

I tested pg_dump --statistics-only from PG18 against PG16 and PG14 —
both work as expected, stats are transferred and restored correctly.

--
Nik

Attachment Content-Type Size
pg-stats-cross-version.patch text/x-patch 2.1 KB

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Laurenz Albe 2026-03-24 06:59:10 Re: [PATCH] Doc: clarify that pg_upgrade statistics transfer works cross-version
Previous Message Lukas Fittl 2026-03-18 22:10:34 Re: pg_stat_statements does not require shared_preload_libraries to be modified