From: Maris Jansons <maris@lailio.net>
To: pgsql-admin@postgresql.org
Subject: Help: unfixable/undead error - missing chunk number 0 for toast value 413511 in pg_toast_25477
Date: Wed, 25 Jan 2017 16:53:37 +0200 (EET)
Message-ID: <2141896725.20994473.1485356017414.JavaMail.zimbra@lailio.net> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-admin>
Hello,
I have run into a case on one of mine psql servers (9.5.3 on Ubuntu 14.04.4) where one table in db seems to be corrupted.
Doing select on this table yields this result:
select * from api_logs;
ERROR: XX000: missing chunk number 0 for toast value 413511 in pg_toast_25477
LOCATION: toast_fetch_datum, tuptoaster.c:1945
I have tried to fix this by following this tutorial: https://newbiedba.wordpress.com/2015/07/07/postgresql-missing-chunk-0-for-toast-value-in-pg_toast/
Reindexing both tables (
REINDEX table pg_toast.pg_toast_25477;
REINDEX table api_logs;
) does not help, VACUUM also gives the same result.
Then I tried finding the bad values with the script:
for ((i=0; i<"Number_of_rows_in_nodes"; i++ ));....
This yielded following offset numbers (9,26838...), as tutorial showed, I did: select id from api_logs offset 9, etc
Then I tried to select those records with thees ids, the weird thing is that select on those records worked.
I then did COPY for these "supposedly broken" ids to csv, deleted them from table and tried VACUUM, which did not help at all.
I also tried to delete offset 8, but this also did not help.
How can I fix this table, what am I doing wrong? Somehow I think the ids of records at those offsets are not the correct ones that are really broken...
Best regards,
Maris.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: maris@lailio.net
Subject: Re: Help: unfixable/undead error - missing chunk number 0 for toast value 413511 in pg_toast_25477
In-Reply-To: <2141896725.20994473.1485356017414.JavaMail.zimbra@lailio.net>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox