PG_CHECKSUMS(1)
π pg_checksums(1) β the checksum glow-up π
okay bestie, welcome to the pg_checksums manual page from the PostgreSQL 14.24 Documentation. This is the tool that checks, enables, or disables data checksums in a PostgreSQL cluster, and yes, it is lowkey iconic. π
β¨ NAME β¨
pg_checksums β enable, disable or check data checksums in a PostgreSQL database cluster. periodt. π¦
πΈ SYNOPSIS πΈ
pg_checksums [option...] [[-D | --pgdata]datadir]
π DESCRIPTION π
So hereβs the vibe: pg_checksums checks, enables or disables data checksums in a PostgreSQL cluster. The server must be shut down cleanly before running pg_checksums, no cap.
When verifying checksums, the exit status is zero if there are no checksum errors, and nonzero if at least one checksum failure is detected. When enabling or disabling checksums, the exit status is nonzero if the operation failed. Thatβs the whole mood. π
When verifying checksums, every file in the cluster is scanned. When enabling checksums, every file in the cluster is rewritten in-place. Disabling checksums only updates the file pg_control. Not me knowing the difference β slay. β¨
π OPTIONS π
The following command-line options are available, bestie:
-Ddirectory,--pgdata=directoryβ Specifies the directory where the database cluster is stored. Housekeeping but make it cute. π-c,--checkβ Checks checksums. This is the default mode if nothing else is specified. Main character default energy. β-d,--disableβ Disables checksums. π-e,--enableβ Enables checksums. π₯-ffilenode,--filenode=filenodeβ Only validate checksums in the relation with filenode filenode. Specific queen behavior. π-N,--no-syncβ By default,pg_checksumswill wait for all files to be written safely to disk. This option causespg_checksumsto return without waiting, which is faster, but means that a subsequent operating system crash can leave the updated data directory corrupt. Generally, this option is useful for testing but should not be used on a production installation. This option has no effect when using--check. Red flag, bestie β testing only, fr fr. π©-P,--progressβ Enable progress reporting. Turning this on will deliver a progress report while checking or enabling checksums. We love a little progress moment. π-v,--verboseβ Enable verbose output. Lists all checked files. Receipts for every single file. π§Ύ-V,--versionβ Print thepg_checksumsversion and exit. π-?,--helpβ Show help aboutpg_checksumscommand line arguments, and exit. π«Ά
π¦ ENVIRONMENT π¦
PGDATAβ Specifies the directory where the database cluster is stored; can be overridden using the-Doption. Default location tea. πPG_COLORβ Specifies whether to use color in diagnostic messages. Possible values arealways,autoandnever. Color coordination is literally self-care. π
β NOTES β
Enabling checksums in a large cluster can potentially take a long time. During this operation, the cluster or other programs that write to the data directory must not be started or else data loss may occur. Do not start anything, bestie β data loss is not the vibe. π
When using a replication setup with tools which perform direct copies of relation file blocks (for example pg_rewind(1)), enabling or disabling checksums can lead to page corruptions in the shape of incorrect checksums if the operation is not done consistently across all nodes. When enabling or disabling checksums in a replication setup, it is thus recommended to stop all the clusters before switching them all consistently. Destroying all standbys, performing the operation on the primary and finally recreating the standbys from scratch is also safe. Consistency is the moment. π
If pg_checksums is aborted or killed while enabling or disabling checksums, the clusterβs data checksum configuration remains unchanged, and pg_checksums can be re-run to perform the same operation. No permanent damage, just re-run energy. π«Ά
okay thatβs the whole page, bestie. nothing skipped, nothing invented, all facts intact and looking cute. π
mwah π β signing off with PostgreSQL 14.24, dated 2026, pg_checksums(1) energy. periodt. πβ¨
π¦ where this page comes from
- opensuse-leap 16.0: postgresql14 14.24-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql14 14.24-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql14 14.24-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql14 14.24-160000.1.1 Β· PostgreSQL
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms