Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gmm8z-0001X6-7E for pgsql-general@arkaria.postgresql.org; Thu, 24 Jan 2019 21:02:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gmm8x-0004ev-Fr for pgsql-general@arkaria.postgresql.org; Thu, 24 Jan 2019 21:02:35 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gmm8x-0004bA-5Y for pgsql-general@lists.postgresql.org; Thu, 24 Jan 2019 21:02:35 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gmm8t-0007SG-Qz for pgsql-general@postgresql.org; Thu, 24 Jan 2019 21:02:34 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x0OL2PxP002958; Thu, 24 Jan 2019 16:02:25 -0500 From: Tom Lane To: Duarte Carreira cc: "pgsql-general@postgresql.org" Subject: Re: duplicate OID issue when using pg_upgrade to move from 9.3 to 9.5 In-reply-to: References: Comments: In-reply-to Duarte Carreira message dated "Thu, 24 Jan 2019 19:28:29 +0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2956.1548363745.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Thu, 24 Jan 2019 16:02:25 -0500 Message-ID: <2957.1548363745@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Duarte Carreira writes: > I've trying to upgrade a 9.3 instance to 9.5 using pg_upgrade and facing= this issue... 9.5.what? Perusing the commit logs, I note that 9.5.3 included a fix for a pg_upgrade issue that could possibly lead to this symptom, see https://git.postgresql.org/gitweb/?p=3Dpostgresql.git&a=3Dcommitdiff&h=3D1= 96870f2f If you are on 9.5.recent, it'd be worth looking closer, because this is certainly pretty odd. One wouldn't expect a CREATE FUNCTION to result in assignment of a type OID, at least not in pg_dump/pg_upgrade scripts --- they should always put out a shell CREATE TYPE first. By any chance, if you attempt a "pg_dump -s" from the problematic database= , does it emit any warnings (about dependency loops, perhaps)? regards, tom lane