A configuration parameter determining whether to error out on damaged page headers

zero_damaged_pages is a configuration parameter determining whether to raise an error if a damaged page header is detected.

zero_damaged_pages was added in PostgreSQL 7.4.


Normally PostgreSQL will report an error and aborting the current transaction if an invalid or damaged page header is detected. If zero_damaged_pages is set to "on", a warning will be emitted and the damaged page will be zeroed out. This will result in the loss of all rows on the damaged page.

The main use case for zero_damaged_pages is to be able to at least partially recover data from a relation which has become corrupted due to software or hardware issues.

IMPORTANT: use of this setting can cause irreparable data loss and should only be considered as a last resort.

Note that zeroed-out pages are not forced to disk so it is recommended to recreate the affected relation before proceeding further.

Default value

The default value for zero_damaged_pages is: off.

Change history


Dangerous thing, Data consistency and forensics, GUC configuration item

See also