Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kdbbB-0002Gh-2o for pgsql-general@arkaria.postgresql.org; Fri, 13 Nov 2020 16:06:53 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kdbbA-00068b-24 for pgsql-general@arkaria.postgresql.org; Fri, 13 Nov 2020 16:06:52 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kdbb8-00068U-Jv for pgsql-general@lists.postgresql.org; Fri, 13 Nov 2020 16:06:51 +0000 Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kdbb5-0006K1-8K for pgsql-general@lists.postgresql.org; Fri, 13 Nov 2020 16:06:50 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 2E7D75C0193; Fri, 13 Nov 2020 11:06:44 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Fri, 13 Nov 2020 11:06:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:cc:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm1; bh=7 7sShWiVrdzWoxmk9oacxINbuNvMUuUksCFCE2LmnkM=; b=PTUiSgcF+md7Zw7Ih UVf6nTYGO/3HrNiGm+hXyb0iDQlPX/WRfW8xCOMqxH1j9IY5A4kTzKxZAMZOp7SI iCw5JHffqLbSlBfZkEdh7ygOb0dITAGwItiIxQTK81xP5gqE2amHOPV8VEAv9/Bu NvgT22G/P6wIMFOeiWJP0X/0J66/NZVDZzlCXbYcI1H6/IY2lu3ki9UUimcnqcsy 524YlxxcDxYRyfAyDfi8+Twxj3rb2yyDLq1OUgLnZZqkRC6lC93Z17gHqFsBjqLq K14n73I/yyb+fTBOwvrVvfGcTHTxoZxSzpsymwa2g2mkVktEd2OXXtVI/W5o888Y daExw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=77sShWiVrdzWoxmk9oacxINbuNvMUuUksCFCE2Lmn kM=; b=XmgitKSngQmXySZtWJIRhWz7TJo4t4Gf1Qdg18TRwaxFVI6qcSznAKH+3 wyzx6RX8sfjweirvmbg3A40MgFXS3sN0HzBvRlVuqA1VaNUoIcG9s5KER31y/Q7b Tc37YgZPrr2DrwRwrfUST5Gsl5gPg+tLbF1fshKHTJAc13XMyyzPbIokLVLEqvqx +bQyKT9ZyUArDCStsLGXWHhGSQr/o6zUoRYR3WU45RFMsDygQSX/vmXlQPCPPej0 9RysQtWpI8z1Jkn+R8BVV4/217Ln/WUd5xmfslbNvgPKvwE/KGN6ZaFghC29YOJk 0nrG+gTsfl1acd/cFrSG77c/11Nfg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedruddvhedgkeegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepuffvfhfhkffffgggjggtgfesthekredttdefjeenucfhrhhomheptegurhhi rghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtoh hmqeenucggtffrrghtthgvrhhnpeevveefveefueegffekkefhgeeiueffgfetueejvdfg hfeujeejhfekjeelgedtgeenucfkphepjeehrddujedvrdduledrudefleenucevlhhush htvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrughrihgrnhdrkhhl rghvvghrsegrkhhlrghvvghrrdgtohhm X-ME-Proxy: Received: from [192.168.1.4] (75-172-19-139.tukw.qwest.net [75.172.19.139]) by mail.messagingengine.com (Postfix) with ESMTPA id E787B328005E; Fri, 13 Nov 2020 11:06:42 -0500 (EST) Subject: Re: Issue upgrading from 9.5 to 13 with pg_upgrade: "connection to database failed: FATAL: database "template1" does not exist" To: Jeremy Wilson , Tom Lane Cc: pgsql-general@lists.postgresql.org References: <793E4164-90E9-41F0-B74C-129E1DB76408@clover.co> <5d5bd3f7-8158-97fa-9d6e-064af852f5ec@aklaver.com> <6DBC6B57-422B-4A5C-8116-5615FEBC0DF7@clover.co> <286345.1605280985@sss.pgh.pa.us> <1F006B57-B6A3-40B0-B92D-C31BAEF52CA1@clover.co> From: Adrian Klaver Message-ID: Date: Fri, 13 Nov 2020 08:06:42 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.4.3 MIME-Version: 1.0 In-Reply-To: <1F006B57-B6A3-40B0-B92D-C31BAEF52CA1@clover.co> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 11/13/20 7:28 AM, Jeremy Wilson wrote: > > >> On Nov 13, 2020, at 10:23 AM, Tom Lane wrote: >> >> Unless ... could it be that there is another PG server active on the >> machine, whose cluster lacks a "template1" database? Seems unlikely, >> but you might try confirming with "ps auxww | grep post" or the like. > > This is a test environment so only the two databases are on it and neither is running. pg_upgrade checks if either is running. When you manually run the pg_upgrade pg_ctl script the server starts but you cannot connect to any database in it correct? What does pg_upgrade_server.log show when you do above? > >> I also wonder if the cluster you're trying to upgrade from has a >> "template1" database. Not sure if anyone has ever tested whether >> pg_upgrade can cope with the lack of one. > > > It’s there: > > $ psql -p 54320 template1 > psql (13.0, server 9.5.23) > Type "help" for help. > > template1=# > > > -- Adrian Klaver adrian.klaver@aklaver.com