Re: [ADMIN] pg_upgrade from 9.1.3 to 9.2 failed

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Rural Hunter <ruralhunter(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: [ADMIN] pg_upgrade from 9.1.3 to 9.2 failed
Date: 2012-09-16 17:17:46
Message-ID: 20120916171746.GA24907@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-hackers

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.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ It's impossible for everything to be true. +

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Kevin Grittner 2012-09-16 17:38:32 Re: what is maximum allowed value of autovacuum_freeze_max_age
Previous Message Rural Hunter 2012-09-16 04:38:37 Re: pg_upgrade from 9.1.3 to 9.2 failed

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2012-09-16 17:56:54 Re: embedded list v2
Previous Message Andrew Dunstan 2012-09-16 16:44:47 Re: Possible fix for occasional failures on castoroides etc