model-writtenrun 6223 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Bertrand Drouvot reported that rewriting a table with TOAST data could leave stale decoding state, causing an OID-zero error or assertion failure, and proposed cleanup and error-path changes in #1.
- David Zhang reproduced the problem and tested the initial patch in #2; his concern about extra decoded output was eventually resolved as a console-display issue in #17.
- Amit Kapila proposed setting relrewrite on transient TOAST tables so decoding would skip their chunks entirely in #4, Dilip Kumar supported that approach in #5, and Bertrand implemented it with a regression test in #9.
- Bertrand explained in #10 that the original memory-accounting error-path adjustment should become a separate patch because it was not specific to TOAST rewrites, and Amit agreed in #11; that adjustment did not land as part of this fix.
- Amit objected to resetting relrewrite inside the generic rename routine in #12; after initially favoring an extra flag to avoid another catalog update in #14, Bertrand chose a dedicated ResetRelRewrite API for clarity in #18.
- Amit endorsed the dedicated API as safer for backpatching and requested clearer command-counter commentary in #19; Bertrand supplied that update and branch variants covering PostgreSQL 11 onward in #20.
- After verifying all branch patches in #21, Amit landed the final submission as 29b5905470 and backpatched through PostgreSQL 11; the commit matches the last readable patch plus the final submission's documented comment correction.
- Bertrand acknowledged the landing and marked the commitfest entry committed in #22, and Amit closed the tracked issue in #23, leaving the TOAST rewrite fix complete.