Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VRPsi-00045S-1d for pgsql-bugs@arkaria.postgresql.org; Wed, 02 Oct 2013 17:06:36 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1VRPsh-0003KV-IC for pgsql-bugs@arkaria.postgresql.org; Wed, 02 Oct 2013 17:06:35 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VRPsh-0003KP-0J for pgsql-bugs@postgresql.org; Wed, 02 Oct 2013 17:06:35 +0000 Received: from momjian.us ([72.94.173.45]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VRPsb-0002lw-VF for pgsql-bugs@postgresql.org; Wed, 02 Oct 2013 17:06:34 +0000 Received: from bruce by momjian.us with local (Exim 4.72) (envelope-from ) id 1VRPsa-0004pA-L4; Wed, 02 Oct 2013 13:06:28 -0400 Date: Wed, 2 Oct 2013 13:06:28 -0400 From: Bruce Momjian To: Christoph Berg , PostgreSQL Bugs Subject: Re: pg_upgrade 9.0->9.2 failure: Mismatch of relation OID in database Message-ID: <20131002170628.GC5960@momjian.us> References: <20130926125930.GC13133@msgid.df7cb.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130926125930.GC13133@msgid.df7cb.de> User-Agent: Mutt/1.5.20 (2009-06-14) X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org On Thu, Sep 26, 2013 at 02:59:30PM +0200, Christoph Berg wrote: > On upgrading a 9.0 database to 9.2 using pg_upgrade, I got this: > > # pg_upgradecluster -m upgrade 9.0 main /psql/data-9.2 > [...] > Performing Upgrade > ------------------ > [...] > Restoring database schema to new cluster ok > Removing support functions from new cluster ok > Copying user relation files > > Mismatch of relation OID in database "hisrm": old OID 18804, new OID 18803 > Failure, exiting > Error: pg_upgrade run failed > > > This is a cluster that was running with 9.0.12 (compiled locally). For > the upgrade, I installed postgresql-9.0 and -9.2 from > apt.postgresql.org (9.0.13, 9.2.4), so pg_upgrade was using these > versions. OS is Ubuntu 12.04 amd64 now and was 8.04 while the cluster > was still running on 9.0.12. > > In the 9.0 cluster, 18804 is the relation oid of glm_lrahm_to_se. > > > pg_upgrade_dump_all.sql: > -- > -- Name: glm_lrahm_to_se; Type: TABLE; Schema: mbs; Owner: fsv; Tablespace: > -- > > > -- For binary upgrade, must preserve pg_type oid > SELECT binary_upgrade.set_next_pg_type_oid('18806'::pg_catalog.oid); > > > -- For binary upgrade, must preserve pg_type array oid > SELECT binary_upgrade.set_next_array_pg_type_oid('18805'::pg_catalog.oid); > > > -- For binary upgrade, must preserve pg_class oids > SELECT binary_upgrade.set_next_heap_pg_class_oid('18804'::pg_catalog.oid); > > CREATE TABLE glm_lrahm_to_se ( > id integer NOT NULL, > lrahm integer NOT NULL, > se integer NOT NULL > ); That is very interesting, and it certainly should not be failing. I am surprised it got an oid that was one less than the desired one, 18803. Is there any mention of 18803 in the SQL file? If you create a cluster with just your schema and no data, can you upgrade that cleanly? -- Bruce Momjian http://momjian.us EnterpriseDB http://enterprisedb.com + It's impossible for everything to be true. + -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs