Data page checksums

Checksums can be added to data pages to assist corruption detection caused by storage system errors.

Checksums can be added to data pages to assist corruption detection caused by storage system errors. They can only be set at initdb time and for the entire database cluster; it is not possible to later convert the cluster or an individual database to use checksums.

Checksums were introduced in PostgreSQL 9.3 (main commit: 96ef3b8f; release notes).

To determine whether checksums are enabled, query the preset GUC data_checksums.

Alternatively, from PostgreSQL 9.6 execute e.g. "SELECT data_page_checksum_version FROM pg_control_init()"; for all versions this value is reported as "Data page checksum version" by pg_controldata. "0" means not enabled.

With PostgreSQL 11, the utility pg_verify_checksums was introduced to enable verification of all data page checksums. In PostgreSQL 12 this has been replaced by the more versatile pg_checksums.

Categories

Storage

See also

initdb, pg_verify_checksums, pg_checksums