[PATCH] Doc: clarify that pg_upgrade statistics transfer works cross-version - Mailing list pgsql-docs

From nik@postgres.ai
Subject [PATCH] Doc: clarify that pg_upgrade statistics transfer works cross-version
Date
Msg-id CAM527d_Qt9ZGt99vgTaidfObRiDH0R5F_uEfum9zHeZbc+LwCQ@mail.gmail.com
Whole thread Raw
Responses Re: [PATCH] Doc: clarify that pg_upgrade statistics transfer works cross-version
List 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

pgsql-docs by date:

Previous
From: Lukas Fittl
Date:
Subject: Re: pg_stat_statements does not require shared_preload_libraries to be modified
Next
From: Laurenz Albe
Date:
Subject: Re: [PATCH] Doc: clarify that pg_upgrade statistics transfer works cross-version