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 1uo7ng-00Ge12-Bb for pgsql-bugs@arkaria.postgresql.org; Mon, 18 Aug 2025 21:53:57 +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 1uo7nf-002fBB-Ds for pgsql-bugs@arkaria.postgresql.org; Mon, 18 Aug 2025 21:53:56 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uo7nf-002fB2-5N for pgsql-bugs@lists.postgresql.org; Mon, 18 Aug 2025 21:53:55 +0000 Received: from mail-io1-xd29.google.com ([2607:f8b0:4864:20::d29]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uo7nd-000XR5-18 for pgsql-bugs@postgresql.org; Mon, 18 Aug 2025 21:53:54 +0000 Received: by mail-io1-xd29.google.com with SMTP id ca18e2360f4ac-88432ccadeaso331621939f.0 for ; Mon, 18 Aug 2025 14:53:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1755554033; x=1756158833; 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=Hs7bb1XaUQ/SLcVOJ+eabi6b/XzjUsTdERL6aobroqo=; b=cMNHqtTc2sk2gk4H6s2lYesW3tEInLd1KTEWvge5DG/1CZbWmjuUv7R6dOX0dUDGQW VIf4Zw8RsqaPRJR8/OuHm6n2lS8P8XhQVpYa8lPahNR7QkjfIh28jkM6psZ5w2l7564z 1lHhKtdSJNgGGrxqJEnAec504hNyJFAVy5ktkAYf7F1hvAEHLLajztBPJwg+vWEFvCvs NYPnQF7bStdIQiY5XUzkLZTcHrmTPOM227KIvkBpHKCcUh/ZAk8ONQGbwdY1ACVV7DWM 4NnZMb1SGGk3jLemuq0moHtAHfAdKlzuseQWqXWQ/EPBckHjpMOsVSqR2oA1cvfzP6hJ XjsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755554033; x=1756158833; 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=Hs7bb1XaUQ/SLcVOJ+eabi6b/XzjUsTdERL6aobroqo=; b=EQ0Uq/pxOWNTq4l4oYdd86yzN4r+JhQpSZAi4cphOXnGW8BoEqgGPvSglHrc98NWdP qx/9FbCZouVoFKKUXICXMWDjQbblCvmwGMLXWcbnQhRz4gJLLXIwoLrgurD7RiYOWJ3u MG7cglbJIOFddHD0gBnQnHtkVzZULRLBAgMxvDyRBG7qV2veLJ+INt5IUPUfIg3yJRGk dHT9CY6pf0CSKgCube6bG907J9zxBHmR3K8K1MnxqK7kLSKUD7NPP/H50yIKOp91yh76 nEPQlxwjtt14d0Gof56tbFiY1Z1Or83VibGLq/QCmdaapPm/O6QXZ06+mIA5RQcI1iRL O0gA== X-Forwarded-Encrypted: i=1; AJvYcCUEjoehYbtslXqufr0l7E1ghBrZzhPbI5Z+b40Hfhcss3flb/OH+ttKLCtuH5kH01K/m1Gt4gLIWjGp@postgresql.org X-Gm-Message-State: AOJu0Yy/ZV77iwQHOfQk0rLEYV/R6hnMrtmx6uaAtAJvikMLYqBGTKFx if+MKmUj5GmSEs+4i4/4khWSGz/8CWlNdTKQrj3YysnDtoKlEjubNBEe X-Gm-Gg: ASbGncvZ5sA+eBI//psXkjBRsxAqDZ5fbCLMzovLQg8XU10ysN5srvN7nFsWOOtpNlk 1GB+ro0nxa3h2oNi1eHObOqyZNqNHMzt1Kx8NOgAk5kyP/VvVQv1Ynkv5RHVmZCHjBhCuBW5Dlf CI5SWeXqYZGiCSbeB37qmeaHtmi6zP198DoRT34qQJRFKAKf9cSG580v3iGE/2eOaA8G2qKFT1V czBKEVfElOFU6mX/PJZXzxMkAjbH5ekz/ovhKJzzEzeptRwxs56fqeBcnc3GMkbEEKTM9QtRFNw MXvC571iOMTK3KTBArWRqBvkDGk0AX68wcuQMBZcxbc/+w2M4YduQgGGFXlFtDQEJ6uYHAY58VR P4m/hH2/lgynsYbbYG1SeV50oUstZbGaqId7Smqz6cbU+EDRC+V6G6K+mPQz5BRYOioWaV3Qq1f y65HMuLqAcp8Hq X-Google-Smtp-Source: AGHT+IEajVESSgb1mMQg8moLY3dfHHVHi+oFwZ30KqTChOLTvb2SrVjYeYYb7ojn14VTSrz/JgcmOw== X-Received: by 2002:a92:ca0b:0:b0:3e5:7929:2dd9 with SMTP id e9e14a558f8ab-3e676668a1dmr6175755ab.18.1755554033056; Mon, 18 Aug 2025 14:53:53 -0700 (PDT) Received: from nathan (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id e9e14a558f8ab-3e6657e5230sm24905525ab.52.2025.08.18.14.53.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Aug 2025 14:53:52 -0700 (PDT) Date: Mon, 18 Aug 2025 16:53:50 -0500 From: Nathan Bossart To: Tom Lane Cc: Andrew Dunstan , "IVAN HUMANES CABANAS (Fujitsu)" , "pgsql-bugs@postgresql.org" Subject: Re: Error pg_upgrade version 11 to 15 Message-ID: References: <417487.1755533405@sss.pgh.pa.us> <6545b4ca-a685-4a30-8aec-451dcb891d0b@dunslane.net> <454618.1755548336@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <454618.1755548336@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, Aug 18, 2025 at 04:18:56PM -0400, Tom Lane wrote: > Yeah. The logic about this is in pg_dump, actually: dumpDatabase() > decides whether or not to add "UPDATE ... SET datistemplate = false" > to the delQry. I was thinking about having it do that either if > the source DB has datistemplate or if its name is template1. > That would cover both (1) restoring a nonstandard set of databases > into the original installation with --clean, and (2) restoring a > nonstandard setup into a pristine installation. I don't think we > need to account for template0 because neither pg_dumpall nor > pg_upgrade will attempt to replace it. > > However, first I'd like confirmation that this theory explains > the OP's problem. WFM, provided your theory is correct. -- nathan