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 1nTm75-0004hT-JX for pgsql-general@arkaria.postgresql.org; Mon, 14 Mar 2022 14:56:00 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nTm74-0007zm-GW for pgsql-general@arkaria.postgresql.org; Mon, 14 Mar 2022 14:55:58 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nTm72-0007zW-Nv for pgsql-general@lists.postgresql.org; Mon, 14 Mar 2022 14:55:58 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nTm6z-00022x-E9 for pgsql-general@lists.postgresql.org; Mon, 14 Mar 2022 14:55:55 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 1E4E05C0064; Mon, 14 Mar 2022 10:55:52 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Mon, 14 Mar 2022 10:55:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm3; bh=p0/S62BwhSLVJH n8+v0HpJpUaEOnnB1WwAj1mN2ChyY=; b=U+gzIwktFPfPPHYAVFuBAlZDxPma/J D/r/qvBk9L1dReUfUGM9EaN+yaGvQJUsQlcrx4hbjzq1FAPvaYKI4ntk7ugsbb/8 9FEJC6yeNJqDQHX2X0WzAl1ZHQXyqqNybqLloD0sRzEvZe4q1WMpsDynxif8bAON GA0arKD9oMtJ2wTeQlJ31Mjk9K6bednowbCYlfMdvffJhimzsvl8EGB27tNtGlMn sNPsMZ/Vzobf2IQLo9DBbJmzAccQPArU5626P2GGPS/vKf5uN2FvlJRxpaAYTquF x3+e+jAi2+zYfu076cHCt5BTHkQvlRJytfBk9ugn18L4Ha4AK8Wyf6tQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:date:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=p0/S62BwhSLVJHn8+v0HpJpUaEOnnB1WwAj1mN2ChyY=; b=QGc7SEUU RSv06yd7+n3IrrExxhzwduWsqR8ihmEjGLKtOdZl4AtdXg1K8YjOhryixnJXvURE hwQFuKIl0ukMhPn9zRLL/izpbbZ/gMNsIxFJ2LvWI9HaI/Ug4NtcCzJHz42q2WIp cw/eyPEYjYuCC1QxN0qTDt3RUgYRtNj5SbnU5C5sGxn+SN1Forop/SzRjXJomecr IkiKqB3c15fto4P/oezuTI3EyGWYjx/4ss5ms9kIEyRZsmDqpeMlwGU7Q2OIJecV YuvTpRoJEVtN+VvvgLs5vYMyTRL58IMzdj5GX+6C4eMhoHxaIZrBHlMbrGo2/nnD FVbawGjOc6LdLQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddruddvkedgieekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvfhfhjggtgfesthejredttdefjeenucfhrhhomheptegurhhi rghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtoh hmqeenucggtffrrghtthgvrhhnpeevvdekiefhudfhhfdtkeelgeffudeigfetjeegfffg hfetfeelledugfelleegveenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmh grihhlfhhrohhmpegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtohhm X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 14 Mar 2022 10:55:51 -0400 (EDT) Message-ID: Date: Mon, 14 Mar 2022 07:55:50 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: Restoring using PG_DUMP in PG12 results in Content-Language: en-US To: "Shukla, Pranjal" , "pgsql-general@lists.postgresql.org" References: <09F60E18-C1ED-4878-B866-0B0CE790CB61@akamai.com> From: Adrian Klaver In-Reply-To: <09F60E18-C1ED-4878-B866-0B0CE790CB61@akamai.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 3/14/22 06:39, Shukla, Pranjal wrote: > Hello, > > We tried importing into an empty database in PG 12 from the dump that > was created in PG 10. Import was successful but we got an message that > an error was ignored. We agin imported with -e option and the following > message was printed: > > pg_restore: while PROCESSING TOC: > > pg_restore: from TOC entry 6; 2615 2200 SCHEMA public postgres > > pg_restore: error: could not execute query: ERROR:schema "public" > already exists Basically an informational error that tells you that the restore was trying to create an object that already exists, in this case the pubic schema. Not really an issue. > > Command was: CREATE SCHEMA public; > > There are some blogs that ar pointing to that fact the error is because > of different versions of PG Admin Utility namely different versions of > pg_dump() and pg_resotre() command in source and destination versions. > We use the following command for pg_dump and pg_restore. > > 1. Have you faced this scenario? > 2. Off the approaches mentioned above, which one do you think we should > opt for while doing migration from PG 10 to 12 (in different machines)? Honestly I could not follow what you did. Best practice when moving from older version to newer version is to use the newer version's pg_dump against the older version and then use the newer versions pg_restore or psql(for text dumps) to restore. > > PS: Below is the command we use to create database: > > /CREATE DATABASE mydb WITH ENCODING 'UTF8' LC_COLLATE 'C' LC_CTYPE 'C' > TEMPLATE template0;/ > > *Thanks & Regards* > > *Pranjal Shukla* > -- Adrian Klaver adrian.klaver@aklaver.com