Hi, On Sun, Sep 13, 2026 at 10:00 PM Michael Paquier <[email protected]> wrote: > > On Fri, Sep 11, 2026 at 08:44:26AM -0700, Bharath Rupireddy wrote: > > > pg_dump/pg_restore for demoing OID4 to OID8 migration for > > existing tables and TOAST table tests during pg_upgrade could be > > follow-up patches. This makes me think, if someone does an OID8 to > > OID4 migration and the chunk_ids are beyond the 4-billion limit, the > > restore should fail rather than silently wrapping the chunk_ids and > > causing TOAST index insert failures. My point is, we need to test this > > case as well. > > Nah, I don't buy that this is worth the cycles. If one has the idea > to create an oid8 TOAST table, inserts more than 4 billion values into > it, dumps and restores into a table that uses a oid TOAST then the > result is an infinite loop in the backend on restored INSERTs. > > Something that I still see as a hole is that we have the tables from > the strings test in the main regression test suite and we could > exploit that a bit more. Hmm. How about resetting the OID in the > control file earlier in the pg_upgrade test and check with a SELECT > post-upgrade that the counters generated by the main regression test > suite are more than 2^32?
I think I found an issue related to pg_dump/pg_restore where a dump and restore after an ALTER TABLE RESET on the reloption would downgrade the TOAST table from oid8 back to oid. More details in the attached 0001 patch. I also attached some more patches that I think would help with the overall pg_dump and pg_restore along with the migration path for existing oid TOAST tables. I used the nocfbot prefix for these patches to not come in the way of the main patches, and they can go after them. Please find them attached. 0001 - fixes the pg_dump/pg_restore downgrade issue 0002 - adds a doc section on the migration 0003 - adds tests for the oid to oid8 migration and vice versa -- Bharath Rupireddy Amazon Web Services: https://aws.amazon.com
nocfbot-v1-0001-pg_dump-Preserve-the-chunk_id-type-of-a-TOAST-rel.patch
Description: Binary data
nocfbot-v1-0002-doc-Describe-how-to-change-the-chunk_id-type-of-a.patch
Description: Binary data
nocfbot-v1-0003-pg_dump-Test-a-requested-change-of-the-chunk_id-t.patch
Description: Binary data
