Re: ERROR: unexpected chunk number 452 (expected 0) for toast value 94674063 in pg_toast_56980977

From: Jorge Torralba <jorge(dot)torralba(at)gmail(dot)com>
To: Shreeyansh Dba <shreeyansh2014(at)gmail(dot)com>
Cc: Naveen Kumar <naveenchowdaryon(at)gmail(dot)com>, pgsql-admin(at)lists(dot)postgresql(dot)org
Subject: Re: ERROR: unexpected chunk number 452 (expected 0) for toast value 94674063 in pg_toast_56980977
Date: 2018-07-18 17:09:30
Message-ID: CACut7uSkZrpFHtDEq6UCoOd5fMpXDvmhzGSh=ZHJx86Ac=nOUg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

If the reindex does not work, You need to loop through the data and
identify which rows are bad and delete them.

Modify the following script to suit your needs and it should help you
identify which rows are bad.

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$

On Wed, Jul 18, 2018 at 9:01 AM, Shreeyansh Dba <shreeyansh2014(at)gmail(dot)com>
wrote:

> Hi Naveen,
>
> Normally we see the chunk errors comes due to the disk IO storage level
> issues and it leads towards the data corruption.
>
> Try reindexing or vacuuming otherwise it may need a detailed analysis to
> resolve these chunk errors.
>
> <http://www.shreeyansh.com>
>
> On Wed, Jul 18, 2018 at 9:15 PM, Naveen Kumar <naveenchowdaryon(at)gmail(dot)com>
> wrote:
>
>> Hello Experts,
>>
>> What could be the reason for bellow errors. Can one help me to fix this?
>>
>> PostgreSQL Database: [~rptdb~] Data Backup Failed with PostgreSQL Error:
>> [~pg_dump: Dumping the contents of table "document" failed: PQgetResult()
>> failed.pg_dump: Error message from server: ERROR: unexpected chunk number
>> 452 (expected 0) for toast value 94674063 in pg_toast_56980977pg_dump: The
>> command was: COPY reports_extended.document (document_id, access_key,
>> created_date, document_name, document_size, document_status, document_type,
>> encryption_type, external_system_storage_id, external_system_storage_url,
>> last_updated_date, md5_hash, source_system_name, storage_type, created_by,
>> customer_org_id, content_type, tags, file, ownedby) TO stdout;~].
>>
>> Thanks & Regards,
>>
>> Naveen Kumar .M,
>> Sr. PostgreSQL Database Administrator,
>> Mobile: 7755929449.
>>
>> My attitude will always be based on how you treat me.
>>
>
>

--
Thanks,

Jorge Torralba
----------------------------

Note: This communication may contain privileged or other confidential
information. If you are not the intended recipient, please do not print,
copy, retransmit, disseminate or otherwise use the information. Please
indicate to the sender that you have received this email in error and
delete the copy you received. Thank You.

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message David G. Johnston 2018-07-18 17:10:21 Re: find objects stored on a specific tablespace
Previous Message Ghiurea, Isabella 2018-07-18 17:06:02 find objects stored on a specific tablespace