On Thu, 2021-05-06 at 17:19 -0500, Justin Pryzby wrote: > If ATRewriteTable didn't > handle this, > data would become inaccessible if an AM failed to de-toast tuples.
If the AM fails to detoast tuples, it's got bigger problems than ALTER TABLE. What about INSERT INTO ... SELECT? It's the table AM's responsibility to detoast out-of-line datums and toast any values that are too large (see heapam.c:heap_prepare_insert()). Regards, Jeff Davis