Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TD6dE-0003M9-V7 for pgsql-admin@postgresql.org; Sun, 16 Sep 2012 04:38:57 +0000 Received: from mail-pb0-f46.google.com ([209.85.160.46]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TD6dB-0007tt-Mk for pgsql-admin@postgresql.org; Sun, 16 Sep 2012 04:38:56 +0000 Received: by pbbrr13 with SMTP id rr13so7488774pbb.19 for ; Sat, 15 Sep 2012 21:38:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=i1CMyexiTf6xcTr0dojy8vYeC8vZlJXL8l573E2CDbI=; b=eAg7P4FMTamzSGMmLV2y+yFAow49O1+7RSsH9JdWNbJbDPOkJvXwAq6nQ16s+4lEhI /45IW67Ayxwo7dAzv3K3kkHa+RruYxPOUqxmfS6kvo0V5eRbAZlvrlXZbnnmqXLhm1HV 1+tan0HlLGsxc7OpJsRjlJBqjV7GLBJHr7cObz9SNzP8+f+5ojHiPa9hoJ39+3ST8aSN 5pRp7BBW6clZOHPYc+Y3egBktHG1uLh/UFTQsaITbEYxqyYEaJb8pmLmg1PIzRMsYPnc JDbZOTqzbYHQO4QPirRUhg/YllbrJEwMYwD1ImALK//MLPCjX0TfPOe+ITmvN9jMbJEt /6sg== Received: by 10.68.223.4 with SMTP id qq4mr13787214pbc.10.1347770331369; Sat, 15 Sep 2012 21:38:51 -0700 (PDT) Received: from [192.168.11.3] ([114.95.126.189]) by mx.google.com with ESMTPS id tw5sm4264355pbc.48.2012.09.15.21.38.43 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 15 Sep 2012 21:38:49 -0700 (PDT) Message-ID: <505557CD.8090304@gmail.com> Date: Sun, 16 Sep 2012 12:38:37 +0800 From: Rural Hunter User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:15.0) Gecko/20120907 Thunderbird/15.0.1 MIME-Version: 1.0 To: Bruce Momjian CC: pgsql-admin@postgresql.org Subject: Re: pg_upgrade from 9.1.3 to 9.2 failed References: <5052C402.8020003@gmail.com> <20120914142616.GA11265@momjian.us> <50535302.8080000@gmail.com> <20120914183915.GA5933@momjian.us> <5053F896.60005@gmail.com> <20120915180603.GA20907@momjian.us> In-Reply-To: <20120915180603.GA20907@momjian.us> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Pg-Spam-Score: -2.7 (--) X-Archive-Number: 201209/90 X-Sequence-Number: 40031 于 2012/9/16 2:06, Bruce Momjian 写道: > 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. > I ran the pg_upgrade with the patch and found the problematic object is a toast object. Copying user relation files /raid/pgsql/base/6087920/6088238 Mismatch of relation OID in database "forummon": old OID 16439148, new OID 16439322 In old cluster: # select * from pg_class WHERE oid=16439148; relname | relnamespace | reltype | reloftype | relowner | relam | relfilenode | reltablespace | relpages | reltuples | reltoastrelid | reltoastidxid | relhasindex | relisshared | relpersistence | relkind | relnatts | relchecks | relhasoids | relhaspkey | relhasrules | relhastriggers | relhassubclass | relfrozenxid | relacl | reloptions -------------------+--------------+----------+-----------+----------+-------+-------------+---------------+----------+-----------+---------------+---------------+-------------+-------------+----------------+---------+----------+-----------+------------+------------+-------------+----------------+----------------+--------------+--------+------------ pg_toast_16439145 | 99 | 16439149 | 0 | 10 | 0 | 16439148 | 0 | 0 | 0 | 0 | 16439150 | t | f | p | t | 3 | 0 | f | t | f | f | f | 630449585 | | (1 row) But it doesn't exist in new cluster: select * from pg_class WHERE oid=16439148; relname | relnamespace | reltype | reloftype | relowner | relam | relfilenode | reltablespace | relpages | reltuples | relallvisible | reltoastrelid | reltoastidxid | relhasindex | relisshared | relpersistence | relkind | relnatts | relchecks | relhasoids | relhaspkey | relhasrules | relhastriggers | relhassubclass | relfrozenxid | relacl | reloptions ---------+--------------+---------+-----------+----------+-------+-------------+---------------+----------+-----------+---------------+---------------+---------------+-------------+-------------+----------------+---------+----------+-----------+------------+------------+-------------+----------------+----------------+--------------+--------+------------ (0 rows)