We help IT Professionals succeed at work.

pg_dump error

twolines
twolines used Ask the Experts™
on
Trying to backup postgresql db:

# pg_dump -U root dbname -f backup.sql
pg_dump: query to obtain list of casts failed: ERROR:  invalid page header in block 1 of relation "pg_cast"
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2011

Commented:
Try re-index the database:
reindexdb -s dbname

Author

Commented:
problem with reindexing:

dbname=# REINDEX TABLE pg_cast;
ERROR:  invalid page header in block 1 of relation "pg_cast"
while, for example:
dbname=# REINDEX TABLE pg_depend;
REINDEX
Top Expert 2011

Commented:
Sounds like your database has been corrupted due to hardware issue.
Please check the system log of your DB server for the clue (error messages) first.
Top Expert 2011
Commented:
I don't have PostgreSQL on hand.
The following thread mentioned about ignoring this type of errors:
http://www.pokertracker.com/forum/viewtopic.php?f=15&t=17645&p=89558#p89558

However, you need to check if your hardware has some issue, such as disk and memory.