Re: Detecting corrupted pages earlier

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Alvaro Herrera <alvherre@dcc.uchile.cl>
Cc: Andrew Sullivan <andrew@libertyrms.info>, pgsql-hackers@postgresql.org
Date: 2003-04-03T04:46:55Z
Lists: pgsql-hackers
Alvaro Herrera <alvherre@dcc.uchile.cl> writes:
> Huh, and what if I accidentaly mistype the number and destroy a valid
> page?  Maybe the command should only succeed if it confirms that the
> page is corrupted.

Good point ... but what if the corruption is subtle enough that the
automatic tests don't notice it?  It could be that only "SELECT * FROM ..."
actually dumps core.  This is an acute problem for tests that are
generic enough to be implemented in just one or a few places --- for
example, the tests I just added have no idea whether they are looking
at a heap or index page, much less what kind of index page.

> There could also be "DESTROY ALL PAGES" and/or "DESTROY n PAGES"
> commands, where the latter zeroes the first n corrupted pages in the
> table, for the case with lots of corrupted pages.  Maybe a command for
> getting a list of the corrupted pages is useful?

We have "DESTROY ALL PAGES", it's called DROP TABLE.  The other doesn't
appeal to me either, because it doesn't say exactly which N pages you're
willing to lose.

			regards, tom lane