Re: [PATCH] pg_upgrade: add --initdb option to create the new cluster automatically - Mailing list pgsql-hackers

From Greg Sabino Mullane
Subject Re: [PATCH] pg_upgrade: add --initdb option to create the new cluster automatically
Date
Msg-id CAKAnmmLskGy4GUbogLuoywLfhnq=khNdACj5NpvpLEaed-yQUw@mail.gmail.com
Whole thread
In response to Re: [PATCH] pg_upgrade: add --initdb option to create the new cluster automatically  (Hüseyin Demir <huseyin.d3r@gmail.com>)
Responses Re: Correct some doc items due to the REPACK
List pgsql-hackers
On Wed, Aug 12, 2026 at 9:28 AM Hüseyin Demir <huseyin.d3r@gmail.com> wrote:
When I run the pg_upgrade command with the following options I'd
expect it to not create a directory and initdb.

```
pg_upgrade --check --initdb -d /old -D /new
```

I see your point. Maybe we don't allow --check with --initdb at all?

also mention that -B flag points outs to target version correctly
since there is a risk of doing an initdb with the wrong version. If -B
points to an older version, pg_upgrade may create the wrong cluster.

I'm not clear what pointing this out for --initdb only accomplishes. A wrong -B is going to cause problems regardless of the mode.

And the --initdb behaviour will introduce additional risks during the
upgrade. During the initdb the settings discovery connections are
allowed on database level and we don't have a guarantee that
checkpoint and vacuums won't start. This needs to be documented
clearly or we should consider eliminating them.

Eliminating what exactly? And why would a vacuum or checkpoint cause problems?
 
Cheers,
Greg

pgsql-hackers by date:

Previous
From: Fujii Masao
Date:
Subject: Re: Rename EXISTS-to-ANY converted subplan to exists_to_any
Next
From: Marcos Pegoraro
Date:
Subject: Re: Correct some doc items due to the REPACK