Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TCwkr-0002Dz-NK for pgsql-admin@postgresql.org; Sat, 15 Sep 2012 18:06:09 +0000 Received: from momjian.us ([72.94.173.45]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TCwko-00071b-6W for pgsql-admin@postgresql.org; Sat, 15 Sep 2012 18:06:09 +0000 Received: from bruce by momjian.us with local (Exim 4.72) (envelope-from ) id 1TCwkl-00075a-MQ; Sat, 15 Sep 2012 14:06:03 -0400 Date: Sat, 15 Sep 2012 14:06:03 -0400 From: Bruce Momjian To: Rural Hunter Cc: pgsql-admin@postgresql.org Subject: Re: pg_upgrade from 9.1.3 to 9.2 failed Message-ID: <20120915180603.GA20907@momjian.us> References: <5052C402.8020003@gmail.com> <20120914142616.GA11265@momjian.us> <50535302.8080000@gmail.com> <20120914183915.GA5933@momjian.us> <5053F896.60005@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="d6Gm4EdcadzBjdND" Content-Disposition: inline In-Reply-To: <5053F896.60005@gmail.com> User-Agent: Mutt/1.5.20 (2009-06-14) X-Pg-Spam-Score: -2.4 (--) X-Archive-Number: 201209/89 X-Sequence-Number: 40030 --d6Gm4EdcadzBjdND Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sat, Sep 15, 2012 at 11:40:06AM +0800, Rural Hunter wrote: > >>>The check is to make sure that once we have created all the user schema > >>>details in the new cluster, that there are the same number of objects in > >>>the new and old databases. > >>> > >>>Obviously there are a different number in your case here, but I don't > >>>know why those would be different, and in fact, because we have never > >>>hit this, there isn't even any debug output that shows the source of the > >>>difference. > >>> > >>>If I send you a patch can you compile it and send back the debug output > >>>it produces? > >>> > >>Yes sure, I will try to compile and retest with it. > >Actually, I have a simpler idea. At the point where it fails, you can > >run pg_dump --schema-only on the testdb database in the old and new > >cluster and then diff those output files and email the result to us; it > >should show the mismatch. I am not sure if the dumps will output the > >objects in the same order, it might. > > > diff attached. OK, I see many new ALTER TABLE commands, but nothing that would cause a difference in relation count. Attached is a patch that will return the OID of the old/new mismatched entries. Please research the pg_class objects on the old/new clusters that have the mismatch and let me know. It might be something that isn't in the old cluster, or not in the new cluster. -- Bruce Momjian http://momjian.us EnterpriseDB http://enterprisedb.com + It's impossible for everything to be true. + --d6Gm4EdcadzBjdND Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="pg_upgrade.diff" diff --git a/contrib/pg_upgrade/info.c b/contrib/pg_upgrade/info.c new file mode 100644 index 74b13e7..caffed3 *** a/contrib/pg_upgrade/info.c --- b/contrib/pg_upgrade/info.c *************** gen_db_file_maps(DbInfo *old_db, DbInfo *** 40,48 **** --- 40,50 ---- int relnum; int num_maps = 0; + /* if (old_db->rel_arr.nrels != new_db->rel_arr.nrels) pg_log(PG_FATAL, "old and new databases \"%s\" have a different number of relations\n", old_db->db_name); + */ maps = (FileNameMap *) pg_malloc(sizeof(FileNameMap) * old_db->rel_arr.nrels); --d6Gm4EdcadzBjdND--