pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Nathan Bossart <nathandbossart@gmail.com>
To: Matthias van de Meent <boekewurm+postgres@gmail.com>
Cc: Dilip Kumar <dilipbalaut@gmail.com>
Cc: Ranier Vilela <ranier.vf@gmail.com>
Cc: pgsql-hackers@postgresql.org
Subject: Re: use CREATE DATABASE STRATEGY = FILE_COPY in pg_upgrade
Date: Wed, 12 Jun 2024 09:41:01 -0500
Message-ID: <ZmmzfdyPGt50rEdi@nathan> (raw)
In-Reply-To: <CAEze2WhfkYQbyRaBptT2BQ5Sv-DN0gEWCuSMWbQzCwyb8qjkBA@mail.gmail.com>
References: <Zl9ta3FtgdjizkJ5@nathan>
	<CAEudQAptbRCeh08gaQKFdazOXPBqZh7UrjRcZ8fixyqkwrkUrA@mail.gmail.com>
	<CAEze2WgjAoU30Kr5y8U4nTNi1F_RMW4HGo1L9ALaVTJYJbDjww@mail.gmail.com>
	<CAFiTN-sj5C__1QV8WSJL3H0jQqvs5BEb14GWeb2VBEYaSApCPg@mail.gmail.com>
	<CAEze2WiHAX1PYtcOpoi82G=ruTqJ9fu5PpYV4TCDd7S_W=_1OA@mail.gmail.com>
	<CAFiTN-uaaaFeZq1ubckuTozWQj+A=dTUaEgdtDN5F-LNyjRfrA@mail.gmail.com>
	<CAEze2WicbrOx6JWy0hK9yySm3gHFqbYE4qcDB+vaYzDCkpnL1Q@mail.gmail.com>
	<ZmewBFgfGQ-Jka_n@nathan>
	<CAEze2WhfkYQbyRaBptT2BQ5Sv-DN0gEWCuSMWbQzCwyb8qjkBA@mail.gmail.com>

On Tue, Jun 11, 2024 at 10:39:51AM +0200, Matthias van de Meent wrote:
> On Tue, 11 Jun 2024 at 04:01, Nathan Bossart <nathandbossart@gmail.com> wrote:
>> It looks like pg_dump always uses template0, so AFAICT we don't even need
>> the suggested manual checkpoint after restoring template1.
> 
> Thanks for reminding me. It seems I misunderstood the reason why we
> first process template1 in create_new_objects, as I didn't read the
> comments thoroughly enough.

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.

-- 
nathan





view thread (21+ messages)  latest in thread

Message-ID: <ZmmzfdyPGt50rEdi@nathan>
Permalink:  ../ZmmzfdyPGt50rEdi@nathan/
Also on:    postgresql.org/message-id/ZmmzfdyPGt50rEdi@nathan

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: nathandbossart@gmail.com, boekewurm+postgres@gmail.com, dilipbalaut@gmail.com, ranier.vf@gmail.com
  Subject: Re: use CREATE DATABASE STRATEGY = FILE_COPY in pg_upgrade
  In-Reply-To: <ZmmzfdyPGt50rEdi@nathan>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox