Re: pg_upgrade fails: Mismatch of relation OID in database 8.4 -> 9.3 - Mailing list pgsql-hackers

From Jeff Ross
Subject Re: pg_upgrade fails: Mismatch of relation OID in database 8.4 -> 9.3
Date
Msg-id 537E15C6.6090904@commandprompt.com
Whole thread Raw
In response to Re: pg_upgrade fails: Mismatch of relation OID in database 8.4 -> 9.3  (Bruce Momjian <bruce@momjian.us>)
Responses Re: pg_upgrade fails: Mismatch of relation OID in database 8.4 -> 9.3
Re: pg_upgrade fails: Mismatch of relation OID in database 8.4 -> 9.3
List pgsql-hackers
On 5/21/14, 2:37 PM, Bruce Momjian wrote:
>
> On Wed, May 21, 2014 at 04:23:34PM -0400, Tom Lane wrote:
>> Bruce Momjian <bruce@momjian.us> writes:
>>> On Wed, May 21, 2014 at 10:56:59AM -0600, Jeff Ross wrote:
>>>> Yes, using 9.3's pg_dump of 8.4 and applying it to both an 8.4 and a
>>>> 9.3 cluster, the contact_email table now has toast in both 8.4 and
>>>> 9.3.
>>
>>> So the big question is why doesn't the existing 8.4 table have a toast
>>> table?  Did you use pg_upgrade on the old cluster before, e.g. from 8.3?
>>
>> I have a vague recollection that we changed the calculations about whether
>> a toast table would be needed, but I can't find it in the commit logs
>> right now --- and anyway I think this was pre-8.4.
>
> The only item I can think of that would cause this is someone changing
> the length of a string.  Did someone modify pg_attribute directly to
> increase the length of one of the character columns?
>

I don't know, sorry.

> I just tested ALTER TABLE in 8.4 and it does create a toast table for
> this case in 9.4:
>
>     CREATE TABLE test (x CHAR(10));
>     ALTER TABLE test ALTER COLUMN x TYPE CHAR(8000);
>
I just tried this on the problem table and it did indeed create a toast 
table.

I then retried pg_upgrade and it failed with the same problem on a 
different table in the same database.  Of the 67 databases in the 8.4 
cluster, 5 (so far) have had this problem on at least one table.

Jeff



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: uuid-ossp (Re: [pgsql-packagers] Postgresapp 9.4 beta build ready)
Next
From: "Paragon Corporation"
Date:
Subject: Re: PostgreSQL 9.4 InterlockedCompareExchange appearing in mingw64-w32 causing issue with PostGIS win32 load