data_checksums
Read PG 18 manual ↗Reports whether data checksums are enabled for this cluster.
- Type
- bool
- Context
- internal
- Measured default
- off
- Unit
- —
- Metadata snapshot
- 18
Definition PG 18 manual
Reports whether data checksums are enabled for this cluster. See -k for more information.
Measured default history
| Version interval | Default |
|---|---|
| 9.3 – 19 | off |
Authored guidance from the GUC source snapshot; the version-specific manual above is the definition reference. View source ↗
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.
Operational considerations
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.
Workload guidance
OLAP: Budget the checksum CPU and full-cluster enable/disable scan on the actual dataset. Verify backup and replica compatibility before the offline transition.
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.
SMALL: 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.
Version history 3
- PG 18 → 19changed
- PG 17 → 18changed
- PG 9.2 → 9.3added
Related entries
Further reading
Definition snapshot: english-manuals:1a322b4e64aaae9bbe0f36e1f5a… · English manual source