Re: Transactional sequence stuff breaks pg_upgrade

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Transactional sequence stuff breaks pg_upgrade
Date: 2017-06-12 22:31:04
Message-ID: 16932.1497306664@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andres Freund <andres(at)anarazel(dot)de> writes:
> On 2017-06-12 17:35:37 -0400, Tom Lane wrote:
>> I thought about trying to insert an assert in GetNewOidWithIndex to
>> ensure that no type OIDs are selected automatically during upgrade,
>> but it seemed a bit too complicated. Might be a good idea to figure
>> it out though, unless you have an idea for removing that requirement.

> I think the only type oids assigned during pg_upgrade are the oids for
> toast type types, right?

Perhaps that was a problem once, but it isn't now; see
binary_upgrade_set_next_toast_pg_type_oid().

In fact, we get through the pg_upgrade regression test with the attached
patch, and I really think we ought to commit it.

Having said that, I wouldn't mind trying to reduce the catalog overhead
for toast tables in v11 or beyond.

> a) Do not create a corresponding composite type for toast tables. Not
> super pretty, but I doubt it'd be a huge issue.

I suspect there are places that assume all tables have type OIDs.

> b) Use *one* composite type for all of the toast tables. That'd not be
> entirely trivial because of pg_type.typrelid.

That might work, with some klugery. Peter might have some insight about
this --- I'm not sure whether the CREATE TABLE OF TYPE syntax shares
a type OID across all the tables.

regards, tom lane

Attachment Content-Type Size
check-upgrade-type-and-relfilenodes-all-assigned.patch text/x-diff 1.5 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2017-06-12 22:37:38 Re: Relpartbound, toasting and pg_class
Previous Message Andres Freund 2017-06-12 22:11:18 Re: Transactional sequence stuff breaks pg_upgrade