Dave Byrne <dbyrne(at)mdb(dot)com> writes:
> 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.
I'm inclined to think the correct fix is to revert the assumption that
the old and new databases contain exactly the same number of tables ...
that seems to have a lot of potential failure modes besides this one.
regards, tom lane