From: Maris Jansons <maris@lailio.net>
To: Jorge Torralba <jorge.torralba@gmail.com>
Cc: pgsql-admin <pgsql-admin@postgresql.org>
Subject: Re: Help: unfixable/undead error - missing chunk number 0 for toast value 413511 in pg_toast_25477
Date: Thu, 26 Jan 2017 11:44:21 +0200 (EET)
Message-ID: <1735117324.25930609.1485423861541.JavaMail.zimbra@lailio.net> (raw)
In-Reply-To: <CACut7uR8ohqdDkn-343SZbBwu-stXRLeZf051dgyrQVaFidQ+g@mail.gmail.com>
References: <2141896725.20994473.1485356017414.JavaMail.zimbra@lailio.net>
<CACut7uQ0Z_+CR2ygXbtnXbsibKuxhLemwNAck6jVMAoq4xm9kQ@mail.gmail.com>
<1715943237.23967907.1485379847032.JavaMail.zimbra@lailio.net>
<CACut7uR8ohqdDkn-343SZbBwu-stXRLeZf051dgyrQVaFidQ+g@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-admin>
I have identified the problematic column, in my case it is api_response, my version of script:
DO $f$
DECLARE
baddata TEXT;
badid INT;
BEGIN
FOR badid IN SELECT id FROM api_logs LOOP
BEGIN
SELECT api_response
INTO baddata
FROM api_logs where id = badid;
EXCEPTION
WHEN OTHERS THEN
RAISE NOTICE 'Data for ID % is corrupt', badid;
CONTINUE;
END;
END LOOP;
END;
$f$
However this script finishes without errors, but if I run simple
> select api_response from api_logs;
I get:
ERROR: missing chunk number 0 for toast value 413511 in pg_toast_25477
Maybe I have messed something up in the script?
Best Regards,
Maris
From: "Jorge Torralba" <jorge.torralba@gmail.com>
To: "Maris Jansons" <maris@lailio.net>
Cc: "pgsql-admin" <pgsql-admin@postgresql.org>
Sent: Wednesday, January 25, 2017 11:52:08 PM
Subject: Re: [ADMIN] Help: unfixable/undead error - missing chunk number 0 for toast value 413511 in pg_toast_25477
I have run this with success several times. I modified it to be intuitive. There may be a typo or two but have a look at this:
DO $f$
DECLARE
baddata TEXT;
badid INT;
BEGIN
FOR badid IN SELECT id FROM badtable LOOP
BEGIN
SELECT badcolumn
INTO columndata
FROM badtable where id = badid;
EXCEPTION
WHEN OTHERS THEN
RAISE NOTICE 'Data for ID % is corrupt', badid;
CONTINUE;
END;
END LOOP;
END;
$f$
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, jorge.torralba@gmail.com
Subject: Re: Help: unfixable/undead error - missing chunk number 0 for toast value 413511 in pg_toast_25477
In-Reply-To: <1735117324.25930609.1485423861541.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