Re: Possible Bug in pg_upgrade

Dave Byrne <dbyrne@mdb.com>

From: Dave Byrne <dbyrne@mdb.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>, Bruce Momjian <bruce@momjian.us>
Date: 2011-08-10T22:17:24Z
Lists: pgsql-hackers

Attachments

Attached is a patch that skips orphaned temporary relations in pg_upgrade if they are lingering around. It works for 9.0 -> 9.1 upgrades, however I wasn't able to tell when pg_class.relistemp was added so if it was unavailable in versions prior to 9.0 an additional check will have to be added.

Thanks
Dave Byrne

-----Original Message-----
From: Tom Lane [mailto:tgl@sss.pgh.pa.us] 
Sent: Wednesday, August 10, 2011 12:29 PM
To: Dave Byrne
Cc: pgsql-hackers@postgresql.org; Bruce Momjian
Subject: Re: [HACKERS] Possible Bug in pg_upgrade 

Dave Byrne <dbyrne@mdb.com> writes:
> Beginning with commit 002c105a0706bd1c1e939fe0f47ecdceeae6c52d
> pg_upgrade will fail if there are orphaned temp tables in the current
> database with the message 'old and new databases "postgres" have a
> different number of relations'

> On line 41 of pg_upgrade/info.c pg_upgrade checks that the number of
> relations are the same but includes orphaned temp tables in the comparison.

> Is this expected behavior?

Seems like an oversight.

			regards, tom lane