From e2a8cabc47f9502d26b1212851b6d43e5c06df22 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=81lvaro=20Herrera?= Date: Tue, 16 Jun 2026 14:26:31 +0200 Subject: [PATCH] concurrent repack: check there are no leftover toast attribs Upon reading attributes from the file of concurrent changes, verify that none are left over unprocessed after we read all columns for the tuple. This should never happen, so add an elog(ERROR) for it. While at it, downgrade a nearby message from ereport() to elog(). These things should never happen. Author: Aleksander Alekseev Discussion: https://postgr.es/m/CAJ7c6TMSF7cANU8nEJ9E28EvU74tE4H7AzT292Rt3ZuHqqxq8w@mail.gmail.com --- src/backend/commands/repack.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c index ec100e3eef5..4d177c868bb 100644 --- a/src/backend/commands/repack.c +++ b/src/backend/commands/repack.c @@ -2806,10 +2806,13 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot) slot->tts_values[i] = PointerGetDatum(value); natt_ext--; if (natt_ext < 0) - ereport(ERROR, - errcode(ERRCODE_DATA_CORRUPTED), - errmsg("insufficient number of attributes stored separately")); + elog(ERROR, "insufficient number of attributes stored separately"); } + + if (natt_ext != 0) + elog(ERROR, + "unexpected number of attributes stored separately (%d remaining)", + natt_ext); } } -- 2.47.3