On Thu, Mar 09, 2006 at 01:48:40PM -0500, Christopher A. Goodfellow wrote:
> I have read quite a bit in the archives and it seems the best way is to
> zero_damaged_pages. I did a search for zero_damaged_pages. Is it as simple
> as adding zero_damaged_pages to postgresql.conf and restarting the
> postmaster?
To be honest, I'd forgotten about zero_damaged_pages (and I must
have overlooked the recent messages in -hackers that mention it).
I'd prefer to set it in a particular session rather than in
postgresql.conf so it happened only when and where I want. Here's
an example:
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
--
Michael Fuhr