|
8 | 8 | *
|
9 | 9 | *
|
10 | 10 | * IDENTIFICATION
|
11 |
| - * $PostgreSQL: pgsql/src/backend/storage/buffer/bufmgr.c,v 1.147 2003/11/29 19:51:56 pgsql Exp $ |
| 11 | + * $PostgreSQL: pgsql/src/backend/storage/buffer/bufmgr.c,v 1.148 2003/12/01 16:53:19 tgl Exp $ |
12 | 12 | *
|
13 | 13 | *-------------------------------------------------------------------------
|
14 | 14 | */
|
@@ -231,7 +231,13 @@ ReadBufferInternal(Relation reln, BlockNumber blockNum,
|
231 | 231 | if (status==SM_SUCCESS&&
|
232 | 232 | !PageHeaderIsValid((PageHeader)MAKE_PTR(bufHdr->data)))
|
233 | 233 | {
|
234 |
| -if (zero_damaged_pages) |
| 234 | +/* |
| 235 | + * During WAL recovery, the first access to any data page should |
| 236 | + * overwrite the whole page from the WAL; so a clobbered page |
| 237 | + * header is not reason to fail. Hence, when InRecovery we may |
| 238 | + * always act as though zero_damaged_pages is ON. |
| 239 | + */ |
| 240 | +if (zero_damaged_pages||InRecovery) |
235 | 241 | {
|
236 | 242 | ereport(WARNING,
|
237 | 243 | (errcode(ERRCODE_DATA_CORRUPTED),
|
|