Re: Data corruption zero a file - help!!

From: Noel Faux <noel(dot)faux(at)med(dot)monash(dot)edu(dot)au>
To: Michael Fuhr <mike(at)fuhr(dot)org>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Data corruption zero a file - help!!
Date: 2006-03-09 23:36:14
Message-ID: 4410BBEE.3050800@med.monash.edu.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

To clarify, when set on, every time it hits this error, postgres will
rezero that block?

Michael Fuhr wrote:
> On Thu, Mar 09, 2006 at 03:57:46PM +1100, Noel Faux wrote:
>
>> Given that this seems problem has occurred a number of times for a
>> number I've written a small step by step procedure to address this
>> issue. Is there any other comments you which to add. I was thinking
>> that this should be added to the FAQ / troubleshooting in the docs.
>>
>> How to repair corrupted data due to "ERROR: invalid page header in block
>> X of relation "Y":
>>
>
> In pgsql-novice Christopher Goodfellow mentioned the zero_damaged_pages
> option that I had forgotten about. If you don't care about examining
> the bad pages then you could set this option in a session and execute
> a statement that hits every page in the file (Tom Lane mentioned
> VACUUM and SELECT COUNT(*)). Here's the example I posted in reply:
>
> test=# select count(*) from foo;
> ERROR: invalid page header in block 10 of relation "foo"
> test=# set zero_damaged_pages to on;
> SET
> test=# select count(*) from foo;
> WARNING: invalid page header in block 10 of relation "foo"; zeroing out page
> WARNING: invalid page header in block 20 of relation "foo"; zeroing out page
> WARNING: invalid page header in block 30 of relation "foo"; zeroing out page
> count
> -------
> 9445
> (1 row)
>
> test=# set zero_damaged_pages to off;
> SET
>
>

Attachment Content-Type Size
noel.faux.vcf text/x-vcard 260 bytes

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2006-03-10 00:25:52 Re: PL/pgSQL question
Previous Message Rick Ellis 2006-03-09 23:21:31 Re: majordomo unmaintained, postmaster emails ignored?