Re: [GENERAL] ERROR: unexpected chunk number 0 (expected 1) for toastvalue 76753264 in pg_toast_10920100 - Mailing list pgsql-general
From | Harry Ambrose |
---|---|
Subject | Re: [GENERAL] ERROR: unexpected chunk number 0 (expected 1) for toastvalue 76753264 in pg_toast_10920100 |
Date | |
Msg-id | CAK4Knu_dxydaskUtvaH0Nk65psjYH3SnCretJf7TN0owAG-z5Q@mail.gmail.com Whole thread Raw |
In response to | Re: [GENERAL] ERROR: unexpected chunk number 0 (expected 1) for toast value 76753264 in pg_toast_10920100 (ADSJ (Adam Sjøgren) <adsj@novozymes.com>) |
List | pgsql-general |
int hasfailed;
hasfailed = 0;
(...)
while ((ttup = systable_getnext_ordered(toastscan, ForwardScanDirection)) != NULL)
{
/*
* Have a chunk, extract the sequence number and the data
*/
residx = DatumGetInt32(fastgetattr(ttup, 2, toasttupDesc, &isnull));
Assert(!isnull);
chunk = DatumGetPointer(fastgetattr(ttup, 3, toasttupDesc, &isnull));
Assert(!isnull);
(...)
/*
* Some checks on the data we've found
*/
if (residx != nextidx)
{
/*
* Remove error status and convert to DEBUG5. Its important to see what other values are returned. We should error outside the loop.
elog(ERROR, "unexpected chunk number %d (expected %d) for toast value %u in %s",
residx, nextidx,
toast_pointer.va_valueid,
RelationGetRelationName(toastrel));
*/
elog(DEBUG5, "unexpected chunk number %d (expected %d) for toast value %u in %s",
residx, nextidx,
toast_pointer.va_valueid,
RelationGetRelationName(toastrel));
hasfailed = 1;
}
(...)
/*
* Log the current chunk number and the expected chunk number
*/
if (hasfailed!=0)
{
elog(DEBUG5, "HARRYAMBROSE - Current chunk number is %d, expecting %d.", residx, nextidx);
}
nextidx++;
} // End while loop
elog(DEBUG5, "HARRYAMBROSE - Has failed is %d after loop", hasfailed);
if (hasfailed!=0)
{
elog(ERROR, "unexpected chunk number exception, please see DEBUG.");
}
Happy to provide further info if required. I have tried to pick only the interesting changes above ^.
Thanks again for your help!
Have a great weekend :)
Harry
pgsql-general by date: