Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sHP9x-0073LF-3s for pgsql-hackers@arkaria.postgresql.org; Wed, 12 Jun 2024 14:41:09 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1sHP9v-001BGB-CT for pgsql-hackers@arkaria.postgresql.org; Wed, 12 Jun 2024 14:41:08 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sHP9v-001BG3-2o for pgsql-hackers@lists.postgresql.org; Wed, 12 Jun 2024 14:41:07 +0000 Received: from mail-io1-xd2c.google.com ([2607:f8b0:4864:20::d2c]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sHP9t-001I1k-Js for pgsql-hackers@postgresql.org; Wed, 12 Jun 2024 14:41:07 +0000 Received: by mail-io1-xd2c.google.com with SMTP id ca18e2360f4ac-7eb5dd9f994so214479439f.2 for ; Wed, 12 Jun 2024 07:41:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718203263; x=1718808063; darn=postgresql.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=2vkCBufHee2MKC1BldBfvXbBXoJWg3dJ6ROqn/u+rdY=; b=iaIsskQsPrp4qOg1fAP+ovIFdMGpoPiKkGh34Oq0RpTnIeeAnctQ/onUQ6hy064cnj 4Ea3+pnDBZo/caRRYpthn5CABJWKrEh9SgIePfZJ1PncILmVGnShvvG8wEgYt18cmApE VeJIJ2Y+rcnRD/T+6oqRMSC/+EzjOsHlv6b6LsS/A8EGdJ6IpVFO8hLvL/Nnz5Ccwyha 9pYZS1OnVATorLogKRaY890qFqHAhw33kkblgSbPX6EeQPcgu9k0uN2Kc0Yqc4eODa22 0VoD3M6WtlbZMp+i2JopbMHdP+FjASIXhxa5iqbGTukfch0/mr9xz/xGtgBpGtOaIc5q 4o+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718203263; x=1718808063; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=2vkCBufHee2MKC1BldBfvXbBXoJWg3dJ6ROqn/u+rdY=; b=AT1h7SLWTHZeADs6UkonFoSv07V2/MKBjtlp93hUEZFUCto1vZOQAOhuDsmOxQw47Q zFYmYnjs1ctaKoibCxp/3bkECxyfL2SuDRX08rrBIXHgYC0ykCDMwWsTj3uW7pB5GupI DupbDv7apFw1j1HhOEGdP82HxTcAbWd7jdltFc/gSMDei4yq9n46B6hYFPvGKhUkJQvP 5fuhE+tMcwhcAB2SNujrMttrltz1N6AiAR5eZrVfRwzEwgR5J4M1Lr+AoZDL35CWOZ74 +yin6aEqL4xy7e93dZhmWGjoJTpbu6khd0AGJbwfdhl9EdYWSIG1gYUeZs5/FJX+x7bS Qs9A== X-Forwarded-Encrypted: i=1; AJvYcCVwHvmSnzuyNxYq2+XD5eLd26LwpzJOvZEPlwVnEGB+pQnkXvr4sfHXCZu45r86/Rzhlw1Rrs8wXELcLJopsMk5QuuJsELP/B+2Cjfw X-Gm-Message-State: AOJu0YxKd7HTfPoI2h9NWICVAK0AJNVtvAh1404EDW0rAv/wLJAifVUV QiZ4Na7ELYTeIDoyy/QnfnoB8Lng7D1GDFzMKSgnllOfx2m4dpZZ X-Google-Smtp-Source: AGHT+IEAeOCdVpRQMl33+sFiyZD58GXyaaxkKO1LwY1FuPHcCtCgqvfbif6cZOfO2uQWAB7wErbyxg== X-Received: by 2002:a05:6602:6b86:b0:7eb:d640:267 with SMTP id ca18e2360f4ac-7ebd64008d0mr88145839f.0.1718203263254; Wed, 12 Jun 2024 07:41:03 -0700 (PDT) Received: from nathan (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4b94e4e4b76sm18310173.82.2024.06.12.07.41.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jun 2024 07:41:02 -0700 (PDT) Date: Wed, 12 Jun 2024 09:41:01 -0500 From: Nathan Bossart To: Matthias van de Meent Cc: Dilip Kumar , Ranier Vilela , pgsql-hackers@postgresql.org Subject: Re: use CREATE DATABASE STRATEGY = FILE_COPY in pg_upgrade Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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 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