Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VPBAT-0005WM-Vg for pgsql-bugs@arkaria.postgresql.org; Thu, 26 Sep 2013 12:59:42 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1VPBAT-0003Xd-Dr for pgsql-bugs@arkaria.postgresql.org; Thu, 26 Sep 2013 12:59:41 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VPBAS-0003Wn-IY for pgsql-bugs@postgresql.org; Thu, 26 Sep 2013 12:59:40 +0000 Received: from feynman.df7cb.de ([195.49.152.168]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VPBAL-0000pC-AS for pgsql-bugs@postgresql.org; Thu, 26 Sep 2013 12:59:40 +0000 Received: from msgid.df7cb.de (benz.df7cb.de [IPv6:2001:6f8:10ee:e:134::2]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (Client did not present a certificate) by feynman.df7cb.de (Postfix) with ESMTPSA id B25456962C for ; Thu, 26 Sep 2013 14:59:31 +0200 (CEST) Date: Thu, 26 Sep 2013 14:59:30 +0200 From: Christoph Berg To: PostgreSQL Bugs Subject: pg_upgrade 9.0->9.2 failure: Mismatch of relation OID in database Message-ID: <20130926125930.GC13133@msgid.df7cb.de> Mail-Followup-To: Christoph Berg , PostgreSQL Bugs MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="eAbsdosE1cNLO4uF" Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Pg-Spam-Score: -4.3 (----) 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 --eAbsdosE1cNLO4uF Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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 =3D '14118' WHERE oid =3D '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 =3D '14118' WHERE oid =3D '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 --=20 cb@df7cb.de | http://www.df7cb.de/ --eAbsdosE1cNLO4uF Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.14 (GNU/Linux) iQIcBAEBCAAGBQJSRC+wAAoJEExaa6sS0qeusAsP/i3Ri1uj6MZ352OETc2cgR4X aJQYoqJZ/J4gkZy43T4SXRabFPV+2eFakN00rfLQDumNMwIrqZVnzUQO7sh9Fk1z Fn2ngPXo8smrpOzxkdFupLV93MZkZo42UUSnEGts5d+SQKuDssie58E1ZlbGH5Dv RQj9ZQ1R1PJDoNXCi4TI+USiChkvMwQ9DqeMYNZ8s/yyQKHNVKvDnHtz7UpRKL8Z s0ozuksNhIE4SYvnFj7yOoTzGXEKqqsFyd/sWnt33W23ZMsOJNZkQcWvD3G3SjEl cXTgzn45FXQMuGrgYr4zmqUeXapEOqPIrJQXJGfJNWvFJuJOGwPqJjKdVKXHn2ip 941P545+zBhwbyz1SDAjAh2wHQ3zgqaX6JOmVsgFU4ga5J/fx2w3HSFmhUXY4Ese OLxB7hjn74FrLcxASi7qc1UO0Cvk6yQH+PsSZCBU+QZMlF73+WR6EhLCPcQhpgcM 5UTCDvsLZn3Bi2s/FQqImitvReYFflTlV73qVgH2lpMUYDhZIaBc4uVb0BGCUp18 dpNQZDj728pRkYCcYY+dlP6PEZAAtCe1cQXHEHPh/HojBxDmFznFnloaEu7GYqI8 cv09DUpQybWLY7SIF0ic0EKm9PsVK2oe/F0M+TLRxo7AJ/3VOLIIramOKgKysdad wHa7PR4KvfPxUfbfLErU =PRZK -----END PGP SIGNATURE----- --eAbsdosE1cNLO4uF--