Thread: Pgdump error "invalid page header in block"

Pgdump error "invalid page header in block"

From
tuanhoanganh
Date:
Yesterday, I had some problem with postgresql 9.0.2. Today i backup postgres and has error

pg_dump: reading dependency data
pg_dump: SQL command failed
pg_dump: Error message from server: ERROR:  invalid page header in block 299 of relation "pg_depend_depender_index"
pg_dump: The command was: SELECT classid, objid, refclassid, refobjid, deptype FROM pg_depend WHERE deptype != 'p' ORDER BY 1,2
pg_dump: *** aborted because of error

Is there any way to fix it.

Thanks in advance

Tuan Hoang ANh

Re: Pgdump error "invalid page header in block"

From
John R Pierce
Date:
On 03/03/11 11:47 PM, tuanhoanganh wrote:
> Yesterday, I had some problem with postgresql 9.0.2. Today i backup
> postgres and has error
>
> pg_dump: reading dependency data
> pg_dump: SQL command failed
> pg_dump: Error message from server: ERROR:  invalid page header in
> block 299 of relation "pg_depend_depender_index"
> pg_dump: The command was: SELECT classid, objid, refclassid, refobjid,
> deptype FROM pg_depend WHERE deptype != 'p' ORDER BY 1,2
> pg_dump: *** aborted because of error
>
> Is there any way to fix it.

the bad news is, this generally indicates a hardware problem caused disk
data to be corrupted.   this could be a memory error corrupting cache,
or the disk channel or drive.  Or, it could be a issue with the OS file
system, failing under heavy concurrent random writes.      Or it could
be a rare bug in postgres, but I've not heard of any block corruptions
in a long long time.

the good news is, its an index, and you can just reindex that table.
thats a system table.  as the postgres user,

     reindex index pg_depend_depender_index;



Re: Pgdump error "invalid page header in block"

From
Vibhor Kumar
Date:
On Mar 4, 2011, at 1:17 PM, tuanhoanganh wrote:

> pg_dump: reading dependency data
> pg_dump: SQL command failed
> pg_dump: Error message from server: ERROR:  invalid page header in block 299 of relation "pg_depend_depender_index"
> pg_dump: The command was: SELECT classid, objid, refclassid, refobjid, deptype FROM pg_depend WHERE deptype != 'p'
ORDERBY 1,2 
> pg_dump: *** aborted because of error


reindexdb -s <database name>

will resolve the issue.

Thanks & Regards,
Vibhor Kumar
EnterpriseDB Corporation
The Enterprise PostgreSQL Company
vibhor.kumar@enterprisedb.com
Blog:http://vibhork.blogspot.com