Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cWP29-0001GO-Vv for pgsql-admin@arkaria.postgresql.org; Wed, 25 Jan 2017 14:58:50 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cWP28-0002tA-GE for pgsql-admin@arkaria.postgresql.org; Wed, 25 Jan 2017 14:58:48 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cWOxK-0006I9-AS for pgsql-admin@postgresql.org; Wed, 25 Jan 2017 14:53:50 +0000 Received: from mx-lv-r1.lailio.net ([178.16.28.24]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cWOxF-0003rB-Fd for pgsql-admin@postgresql.org; Wed, 25 Jan 2017 14:53:49 +0000 Received: from z1.cloud.zimbrazilla.net (unknown [178.16.20.83]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx-lv-r1.lailio.net (Postfix) with ESMTPS id DA433ED27B for ; Wed, 25 Jan 2017 16:54:49 +0200 (EET) Received: from localhost (localhost [127.0.0.1]) by z1.cloud.zimbrazilla.net (Postfix) with ESMTP id 68E98620B67 for ; Wed, 25 Jan 2017 16:53:42 +0200 (EET) Received: from z1.cloud.zimbrazilla.net ([127.0.0.1]) by localhost (z1.cloud.zimbrazilla.net [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id t_wVZNgFGixz for ; Wed, 25 Jan 2017 16:53:37 +0200 (EET) Received: from localhost (localhost [127.0.0.1]) by z1.cloud.zimbrazilla.net (Postfix) with ESMTP id 894E1621EF2 for ; Wed, 25 Jan 2017 16:53:37 +0200 (EET) X-Virus-Scanned: amavisd-new at cloud.zimbrazilla.net Received: from z1.cloud.zimbrazilla.net ([127.0.0.1]) by localhost (z1.cloud.zimbrazilla.net [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id G63JfiQhNKuw for ; Wed, 25 Jan 2017 16:53:37 +0200 (EET) Received: from z1.cloud.zimbrazilla.net (localhost [127.0.0.1]) by z1.cloud.zimbrazilla.net (Postfix) with ESMTP id 733D9620B67 for ; Wed, 25 Jan 2017 16:53:37 +0200 (EET) Date: Wed, 25 Jan 2017 16:53:37 +0200 (EET) From: Maris Jansons To: pgsql-admin@postgresql.org Message-ID: <2141896725.20994473.1485356017414.JavaMail.zimbra@lailio.net> Subject: Help: unfixable/undead error - missing chunk number 0 for toast value 413511 in pg_toast_25477 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="=_2dce9e84-ca19-43c7-9098-32d008c624a1" Thread-Index: UzEACNHU83qGR8/X1UjFJ04Q7Uzvyw== Thread-Topic: Help: unfixable/undead error - missing chunk number 0 for toast value 413511 in pg_toast_25477 X-Pg-Spam-Score: -5.1 (-----) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-admin Precedence: bulk Sender: pgsql-admin-owner@postgresql.org --=_2dce9e84-ca19-43c7-9098-32d008c624a1 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit 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. --=_2dce9e84-ca19-43c7-9098-32d008c624a1 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
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 413= 511 in pg_toast_25477
LOCATION:  toast_fetch_datum, tuptoaster.c:19= 45

I= have tried to fix this by following this tutorial: https://newbiedba.wordp= ress.com/2015/07/07/postgresql-missing-chunk-0-for-toast-value-in-pg_toast/=
Reindexing both tables (

Then I tried finding the bad values with the script:<= !--StartFragment-->
for ((i=3D0; i=
<"Number_of_rows_in_nodes"; i++ ));....
This yie= lded following offset numbers (9,26838...), as tutorial showed, I did: sele= ct id from api_logs offset 9, etc
Then I= tried to select those records with thees ids, the weird thing is that sele= ct on those records worked.
I then did C= OPY for these "supposedly broken" ids to csv, deleted them from table and t= ried 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.
--=_2dce9e84-ca19-43c7-9098-32d008c624a1--