Re: PoC: true in-place major version upgrades

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: John Naylor <johncnaylorls(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: PoC: true in-place major version upgrades
Date: 2026-10-25 00:56:43
Message-ID: at1Ty--_Cj-8WbQd@momjian.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Oct 21, 2026 at 07:00:10AM +0700, John Naylor wrote:
> *** Catalogs (TODO)
>
> While the PoC sidesteps this entirely for now, this is actually how I
> started. About a year and half ago, I experimented with catalog header
> annotations so that the usual couple hundred lines of Perl would
> generate the code that transforms the catalog tuples. Earlier this
> year, I turned that into a throwaway "offline upgrade" (i.e. no WAL)
> prototype. That exercise indicated that this method could feasibly
> handle all catalog schema changes since PG12. Example from pg_class:
>
> ```
> /* # of tuples (not always up-to-date; -1 means "unknown") */
> float4 reltuples BKI_DEFAULT(-1) CHANGEDVALUE(14,
> FUNC(reltuples_zero_to_unknown));
>
> [...]
> /* # of all-frozen blocks (not always up-to-date) */
> int32 relallfrozen BKI_DEFAULT(0) FIRSTVERSION(18, CONST(0));
> ```

As I understand it, instead of recreating the catalogs from pg_dump
--schema-only, you are modifying the actual catalogs. Yes, this will
certainly be faster than what we do now. I never tried this since it
would require changes/testing for each major release, and I didn't think
that would be reasonable. It might now be possible given our resources.

--
Bruce Momjian <bruce(at)momjian(dot)us> https://momjian.us
EDB https://enterprisedb.com

Do not let urgent matters crowd out time for investment in the future.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2026-10-25 01:21:08 Re: PoC: true in-place major version upgrades
Previous Message Tom Lane 2026-10-25 00:56:35 Re: Self-join elimination discards differing row lock wait policies