Re: use CREATE DATABASE STRATEGY = FILE_COPY in pg_upgrade

Nathan Bossart <nathandbossart@gmail.com>

From: Nathan Bossart <nathandbossart@gmail.com>
To: Matthias van de Meent <boekewurm+postgres@gmail.com>
Cc: Dilip Kumar <dilipbalaut@gmail.com>, Ranier Vilela <ranier.vf@gmail.com>, pgsql-hackers@postgresql.org
Date: 2024-06-14T21:29:13Z
Lists: pgsql-hackers

Attachments

On Wed, Jun 12, 2024 at 09:41:01AM -0500, Nathan Bossart wrote:
> Actually, I think you are right that we need a manual checkpoint, except I
> think we need it to be after prepare_new_globals().  set_frozenxids()
> connects to each database (including template0) and updates a bunch of
> pg_class rows, and we probably want those on disk before we start copying
> the files to create all the user's databases.

Here is an updated patch.

-- 
nathan

Commits

  1. Use CREATE DATABASE ... STRATEGY = FILE_COPY in pg_upgrade.

  2. Use TRUNCATE to preserve relfilenode for pg_largeobject + index.

  3. initdb: When running CREATE DATABASE, use STRATEGY = WAL_COPY.