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 1uo68K-00GJWr-GA for pgsql-bugs@arkaria.postgresql.org; Mon, 18 Aug 2025 20:07: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 1uo68J-001wMQ-Lj for pgsql-bugs@arkaria.postgresql.org; Mon, 18 Aug 2025 20:07:08 +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 1uo68J-001wMH-B5 for pgsql-bugs@lists.postgresql.org; Mon, 18 Aug 2025 20:07:08 +0000 Received: from mail-oi1-x235.google.com ([2607:f8b0:4864:20::235]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uo68H-000Whq-0L for pgsql-bugs@postgresql.org; Mon, 18 Aug 2025 20:07:06 +0000 Received: by mail-oi1-x235.google.com with SMTP id 5614622812f47-435de59ddf7so2864452b6e.0 for ; Mon, 18 Aug 2025 13:07:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1755547624; x=1756152424; 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=ppqJnq/ngI5PiJLDq5wzBNH+d/BYl74H1iCUu6t1z/c=; b=I2q07KXLYfx+ToL6LY2sDzDuUtsNxruD0iwcu6/f0QEy12IKPCf+OjVx50eUXUZyTC cAzQgHdYX+2WVQcGe1hXSGW/3t6gCu4sYTcx+sCMocEBSZ2/F7RSiiKkOTv261uyLYXO 7U3EB3KKUF6CMIcNzcEcutnzn3NHanVaSeeWck93CC7ty3NC1FtzWu1TeVqNwaK2GUZx iDeDQ0t4IHWzNJ2kzn3TBiVZl+/BZ2hfy0K2d9PSnp4+wOv8I4qFhVAgkT9+1h9+QxBh 8ATzz/ZHqCjoO+RPRzjG7R3lRkOg6Hxjrj/s+sHID9kTZdurief4yoW6d1w6vhRcP+9R nZHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755547624; x=1756152424; 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=ppqJnq/ngI5PiJLDq5wzBNH+d/BYl74H1iCUu6t1z/c=; b=X46BvOawLN96XME6gFvAWvjkJfppJ9/m5iOY/hv3iEoagNB/KwEXrDP/abj2WfjK/Q Us42QXiKNS6T8iHg5oNVudLZ5WnfBgx5ZuqgrncNy6qbV1ebNiYDvqjNMkSIqu0iR6C9 2vot65UNw39au9BavLNNDUEGrxbWIjgaHcueD0uBmc9SBJO5RmhnAuveeYl0LCuEx1Gd ZofXwHbh7TaebC8u3KMAzdTBJzSsaQJnEbmfUMnHBPHmjJ4BLQB7FqbwEgKC/JsTth0K zilYfw9eQgUE67KhG2mTCCT4Y+IN0AF8qpxeDaI9tGpMAUcvPQOWHlcA7yMOblTgVNuc 7RjA== X-Forwarded-Encrypted: i=1; AJvYcCWfeVrf0Ap2QytXb79fLUtaGVjbCKp+e9+6kjOQQVKbzOrH5/L1Z532tpZjM6LIxQt59DUO1OM9J6Vn@postgresql.org X-Gm-Message-State: AOJu0YyHvTtQ4J4Y/DGlhfjk3B0ZlwefbiQw/pb2+u+d958DXcUJiKsv Z9cSjETCAcHXSjdHnQIrhAQ0HYGgy7SV4H5e7svlTpJGO3F9NCk/9BEZ X-Gm-Gg: ASbGncv6HVU7Rw03XTkUkBkZZudba3p3ALqcdVIRsfk8UX/JDIUznXpIb7leJbur+l4 PuBDGHNIpewV22OZO6zmSi1kaHxCa8aGlRq8nhR1n9TsvmnKWAq6vz/+BCoIgipd9/zEKROEHIO Vgi48K9UOKSLAlbORGj/C7qgs7rR/Os/chBS8ktWUwfAYvYjBgfz1aVbbg7savK2DbxnqRxcoqI 4eBMCD51Dg0VtpOH0FPdaYxIgZMLkkcZg34gSJ8j5t/yJ8ydEWnfnKTeWMh+/vxQgy/vDDT+AIx AoXmmqW8qIVuGbYbbn8GbWm2ZStKep0E0xmwm3XHYHG+UGgnY5h/AWItHg1fcx3MUgYOg7vAtnV 9aZzs82BNbDAxrJHg+PDbVhQzulud3lRKcuzWaQTAmw6FR5x7ChwisJVu1sNYR6QCIPT0ipvS1T 5JgBmjXDiVqBzd X-Google-Smtp-Source: AGHT+IHdg6kzOQ1VxlIF49lh66N4LJd26T2PX2CiG4EmJ3JWa52TCiEbO7fTFduV090NuZPp2ebl3A== X-Received: by 2002:a05:6808:8953:b0:434:e89:2fd5 with SMTP id 5614622812f47-436da4583c7mr36968b6e.34.1755547623754; Mon, 18 Aug 2025 13:07: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-50c947f179asm2907068173.44.2025.08.18.13.07.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Aug 2025 13:07:02 -0700 (PDT) Date: Mon, 18 Aug 2025 15:07:01 -0500 From: Nathan Bossart To: Andrew Dunstan Cc: Tom Lane , "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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6545b4ca-a685-4a30-8aec-451dcb891d0b@dunslane.net> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, Aug 18, 2025 at 03:16:46PM -0400, Andrew Dunstan wrote: > Template1 normally has an OID of 1, but this database has an apparent OID of > 18344416. Maybe this has been the result of a previous upgrade - we don't > have enough information. I don't think pg_upgrade attempts to preserve > database OIDs. It does as of v15 [0]. I concur with Tom that this is most likely due to template1 not being marked as a template database in the source cluster. We could presumably hack pg_upgrade to deal with this for template1 and postgres databases (e.g., by preemptively setting datistemplate = f on the new cluster). Changes to template0 are likely harder to deal with. Since pg_dump uses it as the template for databases it creates, we'd have to wait until all other databases are restored before re-creating it. Plus, we'd probably have to first create a fresh template0 clone (with the source template0's encoding and locale settings) so that there was something to use as a template for template0. There might be other problems, and I'm not sure it's worth the effort, anyway. [0] https://postgr.es/c/aa01051 -- nathan