| From: | Daniel Gustafsson <daniel(at)yesql(dot)se> |
|---|---|
| To: | Heikki Linnakangas <hlinnaka(at)iki(dot)fi> |
| Cc: | shihao zhong <zhong950419(at)gmail(dot)com>, Bohyun Lee <bohyun(dot)lee(at)databricks(dot)com>, Harrison Booth <harrisontbooth(at)gmail(dot)com>, Greg Sabino Mullane <htamfids(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org |
| Subject: | Re: [PATCH] pg_upgrade: add --initdb option to create the new cluster automatically |
| Date: | 2026-11-20 12:40:28 |
| Message-ID: | 9EA8DF55-22D8-484B-8277-F96F1BD211C8@yesql.se |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
> On 20 Nov 2026, at 12:13, Heikki Linnakangas <hlinnaka(at)iki(dot)fi> 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
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Greg Sabino Mullane | 2026-11-20 12:59:50 | Re: [PATCH] pg_upgrade: add --initdb option to create the new cluster automatically |
| Previous Message | Greg Burd | 2026-11-20 12:36:10 | Re: Tepid: selective index updates for heap relations |