pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Christoph Berg <christoph.berg@credativ.de>
To: PostgreSQL Bugs <pgsql-bugs@postgresql.org>
Subject: pg_upgrade 9.0->9.2 failure: Mismatch of relation OID in database
Date: Thu, 26 Sep 2013 14:59:30 +0200
Message-ID: <20130926125930.GC13133@msgid.df7cb.de> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

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
);

-- For binary upgrade, set heap's relfrozenxid
UPDATE pg_catalog.pg_class
SET relfrozenxid = '14118'
WHERE oid = 'glm_lrahm_to_se'::pg_catalog.regclass;


ALTER TABLE mbs.glm_lrahm_to_se OWNER TO fsv;

pg_upgrade_restore.sql:
SELECT binary_upgrade.set_next_pg_type_oid('18806'::pg_catalog.oid);
 set_next_pg_type_oid
----------------------

(1 Zeile)

SELECT binary_upgrade.set_next_array_pg_type_oid('18805'::pg_catalog.oid);
 set_next_array_pg_type_oid
----------------------------

(1 Zeile)

SELECT binary_upgrade.set_next_heap_pg_class_oid('18804'::pg_catalog.oid);
 set_next_heap_pg_class_oid
----------------------------

(1 Zeile)

CREATE TABLE glm_lrahm_to_se (
    id integer NOT NULL,
    lrahm integer NOT NULL,
    se integer NOT NULL
);
CREATE TABLE
UPDATE pg_catalog.pg_class
SET relfrozenxid = '14118'
WHERE oid = 'glm_lrahm_to_se'::pg_catalog.regclass;
UPDATE 1
ALTER TABLE mbs.glm_lrahm_to_se OWNER TO fsv;
ALTER TABLE


(I can provide more info on request.)

Christoph
-- 
cb@df7cb.de | http://www.df7cb.de/

Attachments:

  signature.asc (application/pgp-signature, 835B) download

view thread (3+ messages)  latest in thread

Message-ID: <20130926125930.GC13133@msgid.df7cb.de>
Permalink:  ../20130926125930.GC13133@msgid.df7cb.de/
Also on:    postgresql.org/message-id/20130926125930.GC13133@msgid.df7cb.de

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: christoph.berg@credativ.de
  Subject: Re: pg_upgrade 9.0->9.2 failure: Mismatch of relation OID in database
  In-Reply-To: <20130926125930.GC13133@msgid.df7cb.de>
  References: <20130926125930.GC13133@msgid.df7cb.de>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox