Re: pg_upgrade allows itself to be run twice - Mailing list pgsql-hackers

From Justin Pryzby
Subject Re: pg_upgrade allows itself to be run twice
Date
Msg-id 20220905170322.GM31833@telsasoft.com
Whole thread Raw
In response to Re: pg_upgrade allows itself to be run twice  (Justin Pryzby <pryzby@telsasoft.com>)
List pgsql-hackers
rebased and updated

Robert thought that it might be reasonable for someone to initdb, and
then connect and make some modifications, and then pg_upgrade.
https://www.postgresql.org/message-id/CA%2BTgmoYwaXh_wRRa2CqL4XpM4r6YEbq1%2Bec%3D%2B8b7Dr7-T_tT%2BQ%40mail.gmail.com

But the DBs are dropped by pg_upgrade, so that seems to serve no
purpose, except for shared relations (and global objects?).  In the case
of shared relations, it seems unsafe (even though my test didn't cause
an immediate explosion).

So rather than continuing to allow arbitrary changes between initdb and
pg_upgrade, I propose to prohibit all changes.  I'd consider allowing an
"inclusive" list of allowable changes, if someone were to propose such a
thing - but since DBs are dropped, I'm not sure what it could include.

Attachment

pgsql-hackers by date:

Previous
From: Nikita Malakhov
Date:
Subject: Re: Table AM modifications to accept column projection lists
Next
From: Tom Lane
Date:
Subject: Re: Remove dead macro exec_subplan_get_plan