Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TDQFP-0003vV-0D for pgsql-hackers@postgresql.org; Mon, 17 Sep 2012 01:35:39 +0000 Received: from mail-pb0-f46.google.com ([209.85.160.46]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TDQFM-0004qc-WF for pgsql-hackers@postgresql.org; Mon, 17 Sep 2012 01:35:38 +0000 Received: by pbbrr13 with SMTP id rr13so8276401pbb.19 for ; Sun, 16 Sep 2012 18:35:35 -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=JJg2kDfWJDtvGnjHMNYjtGb6VJekQOdww4nz1EZC8UQ=; b=cH47p/CbqE7LnhtQfpXSv/dRNQxsn8M9hlFGtP6BZY4yf619lI/ooSaO+5KA7Hcg9X cC7opTrE/vvIi/+u43Fqulv93Mfu8nadKxDY/HIVi+jPX/9UAuzFV87SEPaJ9wRtmwsf 2bKzfk2TQhSAMJJmIJy0QH4Hf+P7oVt+PVJFxjpH7hR+wqykYmXtB90vJOX7JN0uAnGg nGWAWCw0KlukdZyzKy1RIunGlbnK7hAH63I+WOggUgtV4BjQk1/j0cgZAbJsqQQvX7R7 FfDTLdce0XYFdaDmDU9UvkqpSirHRWITlE7/N1h0QYy7UFMvdlGQCOrxTPkR+EsbrWX7 aLWg== Received: by 10.68.222.170 with SMTP id qn10mr19118815pbc.114.1347845735727; Sun, 16 Sep 2012 18:35:35 -0700 (PDT) Received: from [192.168.1.7] ([116.226.32.153]) by mx.google.com with ESMTPS id ox5sm6037425pbc.75.2012.09.16.18.35.32 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 16 Sep 2012 18:35:34 -0700 (PDT) Message-ID: <50567E60.2000005@gmail.com> Date: Mon, 17 Sep 2012 09:35:28 +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: PostgreSQL-development Subject: Re: [ADMIN] 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> <505557CD.8090304@gmail.com> <20120916171746.GA24907@momjian.us> In-Reply-To: <20120916171746.GA24907@momjian.us> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Pg-Spam-Score: -2.6 (--) X-Archive-Number: 201209/624 X-Sequence-Number: 213652 于2012年9月17日 1:17:46,Bruce Momjian写到: > On Sun, Sep 16, 2012 at 12:38:37PM +0800, Rural Hunter wrote: >>> 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) > > [ Thread moved to hackers list.] > > OK, this is exactly what I wanted to see, and it explains why pg_dump > didn't show it. Can you find out what table references this toast > table? Try this query on the old cluster: > > select oid, * from pg_class WHERE reltoastrelid = 16439148; > > I believe it will have an oid of 16439145, or it might not exist. > # select oid, * from pg_class WHERE reltoastrelid = 16439148; oid | 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 ----------+--------------+--------------+----------+-----------+----------+-------+-------------+---------------+----------+-----------+---------------+---------------+-------------+-------------+----------------+---------+----------+-----------+------------+------------+-------------+----------------+----------------+--------------+-----------------------------------------+------------ 16439145 | sql_features | 16438995 | 16439147 | 0 | 10 | 0 | 16439145 | 0 | 0 | 0 | 16439148 | 0 | f | f | p | r | 7 | 0 | f | f | f | f | f | 630449585 | {postgres=arwdDxt/postgres,=r/postgres} | (1 row) It's not a table. I haven't seen this name before. not sure why it exists. So what's the next thing I can do?