> On 20 Nov 2026, at 12:13, Heikki Linnakangas <[email protected]> wrote:
> ..this is a case of "I know exactly what options you need to use, and I will > complain if you get them wrong, but I won't tell you what those options are > until you try." Regardless of the fate of this patch, we reallt ought to document this. Currently we have "use compatible initdb flags that match the old cluster" which is pretty dismal. > I think the current "pg_upgrade --initdb" mode where it just creates the > cluster for you is still useful and convenient for anyone running pg_upgrade > directly, In the current age of SaaS and the availability of thirdparty external wrappers, I wonder how many that actually run pg_ugrade manually (and how many of those that do are powerusers). > and for simpler scripts that don't have extra configuration steps like > pg_upgradecluster does. Making it convenient for this class of wrappers is in itself a win... > So I would keep that too. But one way or another, more complicated scripts > need to have the control back between running initdb and performing the > upgrade. ...but I agree that if can't offer simplification to the likes of pg_upgradecluster then ratio between complexity and benefit seem less appealing. In the spirit of taking a step back, do we know that initdb is the only operation which the external scripts would like some controll around? What if we defined the upgrade in terms of stages, where a stage can either be a single operation (like initdb) or multiple operations in sequence. External scripts could then drive the upgrade process by calling the stages in order, and have the option to perform their own processing between the stages. Apps that drive pg_dump have long wished for a libpgdump, I wonder if making pg_upgrade more into a library of upgrade functionality could avoid repeating that "mistake" (for lack of a better term here). -- Daniel Gustafsson
