data_checksums
Fact — official short description: “Shows whether data checksums are turned on for this cluster.”
Identity
Lifecycle
| Fact | Value |
|---|---|
| First observed | PG9.3 |
| Present in | PG9.3–19 Beta 3 |
| Removed in | No |
| Introduction commit | 5a7e75849cb5 — Add a GUC to report whether data page checksums are enabled. |
| Commit date | 2013-09-16 |
| Discussion | — |
Default history
| Versions | Raw boot_val |
Unit | Human value |
|---|---|---|---|
| PG9.3–19 Beta 3 | off |
— | off |
How it works
Reports the cluster-wide data-checksum state stored in the control file. It is internal/read-only in SQL and cannot be changed with SET.
Checksums are chosen by initdb or changed later with the server stopped by pg_checksums. PostgreSQL verifies page checksums when reading from storage and computes them when writing pages.
A checksum detects a torn or corrupted page; it does not repair it or prove that WAL, backups, memory, and every storage layer are healthy. Changes require an offline procedure, capacity for a full-cluster scan, and a verified backup.
Tuning advice
Advice. These are workload-specific starting points and must be validated with measurements.
| Workload | Guidance |
|---|---|
| OLTP | Treat the value as an integrity capability, not a performance knob. Prefer checksums for persistent clusters and monitor checksum failures; use a planned offline pg_checksums procedure for an existing cluster. |
| OLAP | Budget the checksum CPU and full-cluster enable/disable scan on the actual dataset. Verify backup and replica compatibility before the offline transition. |
| Small nodes | Enable at initdb when possible. For an existing small cluster, pg_checksums is usually simpler than a rebuild, but still requires shutdown and a recoverable backup. |
Pigsty
Values use the fixed 8-vCPU, 32-GiB, 100-GiB SSD fixture and render the current Pigsty templates for PG19 Beta 3; this does not assert current Pigsty support for that historical or beta release.
| Template | Effective value | Versus upstream boot | Source expression |
|---|---|---|---|
| OLTP | Unmodified | — | — |
| OLAP | Unmodified | — | — |
| CRIT | Unmodified | — | — |
| TINY | Unmodified | — | — |
Advice — pending human review. Fact from the current Pigsty template projection: OLTP: PG9.3–19 Beta 3 unmodified; OLAP: PG9.3–19 Beta 3 unmodified; CRIT: PG9.3–19 Beta 3 unmodified; TINY: PG9.3–19 Beta 3 unmodified. No Pigsty-specific rationale is inferred from an absent override.
Common pitfalls
- Trying to change the read-only report with SET or ALTER SYSTEM.
- Running pg_checksums while the server is not cleanly shut down.
- Treating a checksum failure as repairable by ignoring the error.
- Assuming checksums validate WAL records, logical correctness, or backups by themselves.
- Enabling checksums without monitoring checksum failures and storage health.
Related parameters
ignore_checksum_failure · zero_damaged_pages · wal_log_hints · full_page_writes · data_directory · block_size