When i dump my postgres database , igot the error "pg_dump: ERROR:  missing chunk number 0 for toast value 33956310" how to fix this ?

Posted on 2008-11-17
Last Modified: 2012-05-05
when i dump  postgres database  "itlive " . i got the error " pg_dump: ERROR:  missing chunk number 0 for toast value 33956310" "pg_dump: SQL command to dump the contents of table "ctattach" failed: PQendcopy() failed.
g_dump: The command was: COPY public.ctattach (ctattachid, ctfiledetail, ctfilename, ctattachment, ctattachedby, ctattacheddate, ctusertype, ctisescalatedreport, ctattachedby_companyid, ctattachedby_type) TO stdout;" . i can see the output size as 1Gb . what is abt this error & how to fix .?
Question by:kumarnirmal
    LVL 61

    Expert Comment

    Can you provide:
    1) exact size of output in bytes
    2) version of postgresql
    3) version of operating system
    LVL 7

    Author Comment

    2)postgressql 7.4
    3)suse 9
    LVL 7

    Author Comment

    1) exact size of output in bytes =1091737
    LVL 61

    Expert Comment

    Exact information means:
    1) ls -l the.file
    2) select version();
    3) uname -a

    Error you mention is due to bug in old database. You reindexed one table and all tables that references to it will show this error.
    You can reindex ctattach, select * from ctattach or do vacuum full (analyse) (verbose);
    LVL 7

    Author Comment

    Hi i have already tried this reindexing and vacuumfull , no sweet.Here with giving detail

    1) -rw-r--r--  1 root root 1116844167 Aug 19 07:43 ithelpdesk_live.sql
    2)PostgreSQL 7.4.2 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 3.3.3 (SuSE 3)Linux)PostgreSQL 7.4.2 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 3.3.3 (SuSE Linux)
    LVL 61

    Accepted Solution

    1) Size is not even, so there is no OS limitation hitting
    2) thats old as hell.

    I have found 3 error handling in updates in pg_dump* around here:

    Can you transfer data directory to windows and do pg_dumpall v7.4.23 from there?
    LVL 2

    Assisted Solution

    I would expect that a missing chunk error message indicates either corruption of the table ctattach or corruption of the associated "toast" table or its index. Basically the error means that it couldn't find a value.

    There are a couple of ways you can proceed - I'm not sure that a newer version will necessarily help though.

    If you do "select reltoastrelid from pg_class where relname='clattach';

    ...and note the number you get.

    Then do "select relname from pg_class where oid =12345;

    (where 12345 was the number you got previously)

    and try "reindex table pg_toast_23456" where pg_toast_23456 was the name you received above.

    This may not help you, but is worth trying.


    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    Join & Write a Comment

    Suggested Solutions

    Best database to use for Maps is PostgreSQL. This is an open source database. Comes as a package with most Linux OS. For more info visit the following site: ( This requires some add-o…
    Many developers have database experience, but are new to PostgreSQL. It has some truly inspiring capabilities. I have several years' experience with Microsoft's SQL Server. When I began working with MySQL, I wanted a quick-reference to MySQL (htt…
    Steps to create a PostgreSQL RDS instance in the Amazon cloud. We will cover some of the default settings and show how to connect to the instance once it is up and running.
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now