Re: Possible Bug in pg_upgrade

From: Dave Byrne <dbyrne(at)mdb(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Bruce Momjian <bruce(at)momjian(dot)us>
Subject: Re: Possible Bug in pg_upgrade
Date: 2011-08-10 22:17:24
Message-ID: 41643DEB39E4DA4EB6A7AF4A8C9F88BB7E71B887@mdb-mail2kX.MDBCapital.local
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


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(at)sss(dot)pgh(dot)pa(dot)us]
Sent: Wednesday, August 10, 2011 12:29 PM
To: Dave Byrne
Cc: pgsql-hackers(at)postgresql(dot)org; Bruce Momjian
Subject: Re: [HACKERS] Possible Bug in pg_upgrade

Dave Byrne <dbyrne(at)mdb(dot)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

Attachment Content-Type Size
pg_upgrade_tmp.patch application/octet-stream 1.4 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2011-08-10 22:53:32 Re: Possible Bug in pg_upgrade
Previous Message Dimitri Fontaine 2011-08-10 22:01:55 Re: mosbench revisited