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 1nU9R0-0004me-Kx for pgsql-general@arkaria.postgresql.org; Tue, 15 Mar 2022 15:50:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nU9Qz-0003Vc-If for pgsql-general@arkaria.postgresql.org; Tue, 15 Mar 2022 15:50:05 +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 1nU9Qy-0003VT-KJ for pgsql-general@lists.postgresql.org; Tue, 15 Mar 2022 15:50:05 +0000 Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nU9Qv-0006rm-DU for pgsql-general@lists.postgresql.org; Tue, 15 Mar 2022 15:50:04 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 5E34F5C028F; Tue, 15 Mar 2022 11:49:59 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Tue, 15 Mar 2022 11:49:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc: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=THoALbtW/kkrN7 4/1lL16L8oK9p0DyMEibn2zNFiPP4=; b=T+hB037EKAgGAdBbqnIiOQmDoasPum W34jS9mRu4ZAwmDNUjQPh2Dp7uvX8e6ElA2OmaknKk2oUjHvYjwpSzfUH1vwYhpD HsVjxNwWQYE/U2OxxtXjWrGfxI3773PSLNO3Zzq6gVtVrvslOI1kdh2hA9a8HAKc Rz/FXmq6YFtndBprc+MuZ0/ZY7NK2rDHQ/85HfrFl3sgGBjKk2niP1Fl7h+CrokL q6Rt6pRz05us+pC1xXSeu9gXza2ufEMz37Z/U+oIM2olWZTDznGdZ1vGQE2x6E3x OHWdKLp1RmKXmpBrQZzNLRhrz9bpZHYhAT0Ca/mYLLVSvrbpTUTd+VsA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc: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=fm3; bh=THoALbtW/kkrN74/1lL16L8oK9p0DyMEibn2zNFiP P4=; b=OnLFv6pfSkORi1ondBFVyachvt0GY9WhX76cfCzA2hl3Xh1xO4n2k6Sd5 nnA3/eYpaERAaW79FLbM+OOgN5HhN2FJp9/UIJoPJc0ss4pbDhTyqkJYTJcBbY0E sbmQuOKiaRZGMgGjb/2kkeCogzPIG5SwWE2MbrglAoBrd0a4mcbshhj2EvMZQVGT 3Bi/FFeqJP6VjKEMA1IXeZCBtX492nZ608aKjomKXEJWRAzsRlyU64hvXNOr/2Lv wpOXijVFEvCIo1e4W71p8/rdZTJSEd6II0aYXAULoPjYf8oHkb1Gk9pxNMaYU7sU z/bQUMnA0KwTmZo4897IHIyZPKcVA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrudeftddgkedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvfhfhjggtgfesthekredttdefjeenucfhrhhomheptegurhhi rghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtoh hmqeenucggtffrrghtthgvrhhnpedugfeuleegveffhfegleejhefhtedtgeeileeggfeh fefffeevgeejtdeutefftdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmh grihhlfhhrohhmpegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtohhm X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 15 Mar 2022 11:49:58 -0400 (EDT) Message-ID: Date: Tue, 15 Mar 2022 08:49:57 -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" Cc: "pgsql-general@lists.postgresql.org" References: <09F60E18-C1ED-4878-B866-0B0CE790CB61@akamai.com> <6BFB67E1-42F0-44E6-99D9-31174753AC47@akamai.com> From: Adrian Klaver In-Reply-To: <6BFB67E1-42F0-44E6-99D9-31174753AC47@akamai.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 3/14/22 23:42, Shukla, Pranjal wrote: > Thanks Adrian, > Can we say that, "Despite an informational Error, entire data got imported with sanity in the original case"? Yes. To verify see that the public schema is there and has tables and other objects in it. Also, can we say that either of the approaches mentioned i.e. Approach 1 & 2 are equally good to do migration from PG 10 to PG 12? As I said before I could not understand what you did. The best approach in your case is to: 1) Use the Postgres 12 version of pg_dump to dump the Postgres 10 server. 2) Use the Postgres 12 version of pg_restore to restore it to the Postgres 12 server. > > Thanks & Regards > Pranjal Shukla > > On 3/14/22, 8:25 PM, "Adrian Klaver" wrote: > > 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 > -- Adrian Klaver adrian.klaver@aklaver.com