trying to repair a bad header block

From: gherzig(at)fmed(dot)uba(dot)ar
To: pgsql-sql(at)postgresql(dot)org
Subject: trying to repair a bad header block
Date: 2008-10-29 21:59:29
Message-ID: c724f1f39aa1bb5da252f689dab95377.squirrel@www.webmail.fmed.uba.ar
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi all. I've seen this searching in google. After a select on a table, i
got this:
ERROR: invalid page header in block 399 of relation "xxx"

I read about a tool called pg_filedump, and after some searchs about its
usage, i execute
pg_filedump $PG_DATA/base/xx/1234 (1234 is the oid of table xxx)

As expected, i found the "Invalid header information" in block 399.
Lots of this things inside:
Block 399 ********************************************************
<Header> -----
Block Offset: 0x0031e000 Offsets: Lower 1663 (0x067f)
Block: Size 0 Version 95 Upper 0 (0x0000)
LSN: logid 5714531 recoff 0x000000e0 Special 60660 (0xecf4)
Items: 410 Free Space: 4294965633
Length (including item array): 1660

Error: Invalid header information.

<Data> ------
Item 1 -- Length: 0 Offset: 2600 (0x0a28) Flags: 0x00
Item 2 -- Length: 0 Offset: 0 (0x0000) Flags: 0x00
Item 3 -- Length: 0 Offset: 0 (0x0000) Flags: 0x00
Item 4 -- Length: 0 Offset: 0 (0x0000) Flags: 0x00
Item 5 -- Length: 32767 Offset: 32767 (0x7fff) Flags: USED
Error: Item contents extend beyond block.
BlockSize<8192> Bytes Read<8192> Item Start<65534>.

This for several items.
Im triyng to 'repair' those items in any way, so i can dump the database
and analyze the hardware.

There is a way to 'correct' or blank the values somehow? I guess im going
to lose some data, iisnt...

Any hints?

Gerardo

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2008-10-29 22:23:38 Re: trying to repair a bad header block
Previous Message Andreas Joseph Krogh 2008-10-29 21:50:16 Re: simple SQL query