Re: [HACKERS] Transactional sequence stuff breaks pg_upgrade - Mailing list pgsql-hackers

From Robert Haas
Subject Re: [HACKERS] Transactional sequence stuff breaks pg_upgrade
Date
Msg-id CA+TgmobZhwAOwudbXaEB0WQ8C-qL9kPCGDUsu3EMY_VhDDY7zg@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] Transactional sequence stuff breaks pg_upgrade  (Andres Freund <andres@anarazel.de>)
Responses Re: [HACKERS] Transactional sequence stuff breaks pg_upgrade
List pgsql-hackers
On Mon, Jun 12, 2017 at 5:25 PM, Andres Freund <andres@anarazel.de> wrote:
> Even there I don't think that's a sane assumption *for the future*. We
> just need a slight change in the rules about when a toast table is needed
> - and that stuff seriously need overhauling - and it doesn't work
> anymore.

The problem is that if a relfilenode ever gets assigned by
GetNewRelFileNode() during a binary-upgrade restore, that OID may turn
out to be used by some other object later in the dump.  And then
you're dead, because the dump restore will fail later on complaining
about, well, I forget the error message wording exactly, but,
basically, an OID collision.  So if we change the rules in such a way
that objects which currently lack TOAST tables acquire them, we need
to first restore all of the objects *without* adding any new TOAST
tables, and then at the end create any new TOAST tables once we have a
complete list of the relfilenodes that are actually used.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



pgsql-hackers by date:

Previous
From: Julien Rouhaud
Date:
Subject: [HACKERS] Typo in BRIN documentation
Next
From: Robert Haas
Date:
Subject: Re: [HACKERS] RTE_NAMEDTUPLESTORE, enrtuples and comments