Re: Corrupted Table - Mailing list pgsql-general

From Tom Lane
Subject Re: Corrupted Table
Date
Msg-id 12951.965075264@sss.pgh.pa.us
Whole thread Raw
In response to Re: Corrupted Table  ("Bryan White" <bryan@arcamax.com>)
List pgsql-general
"Bryan White" <bryan@arcamax.com> writes:
> I am wiling to spend some time to track this down.  However I would prefer
> to not keep crashing my live database.  I would like to copy the raw data
> files to a backup maching.  Are there any catches in doing this.

Shut down the postmaster and then copy the entire db (including pg_log
file) and it should work.  The catch is to make sure pg_log is in sync
with your table files.

> How hard would it be to write a utility that would walk a table looking this
> kind of corruption?  Are the on-disk data formats documented anywhere?

I don't think there's a single handy-dandy reference, although you can
learn a lot from the header files in src/include/storage/.

Not sure about the value of a utility like that --- seems like it'd
always be prepared to fight the last war rather than the next one,
since anything we learned about likely failure patterns would probably
get folded into the main code.  But if you feel like working on one,
far be it from me to stop you...

            regards, tom lane

pgsql-general by date:

Previous
From: "Bryan White"
Date:
Subject: Re: Corrupted Table
Next
From: "Bryan White"
Date:
Subject: Re: Corrupted Table