{"Entry":{"collection":"tool","key":"pg-checksums","name":"pg_checksums","aliases":["pg_checksums"],"metadata":{"aliases":["pg_checksums"],"category":"Server applications","content_hash":"66b6d0a99982350e948adee238f9c25b29aef70d8455235184b771718a1b703d","imported_at":"2026-09-30T00:40:34.092677+08:00","name":"pg_checksums","name_zh":"","slug":"pg-checksums","summary":"pg_checksums — enable, disable or check data checksums in a PostgreSQL database cluster"}},"Definition":{"Collection":"tool","Key":"pg-checksums","SourceDatabase":"center","Version":"18","SourceTable":"command_tool","SourceKey":"pg-checksums","SourceRevision":"ee8d1a3612338fd9adf250730cb640fcc5233b5491337cc00a316a44e3a0b9f8","Facts":{"comparison_data":{"environment":[{"description":"Specifies the directory where the database cluster is stored; can be overridden using the -D option.","name":"PGDATA"},{"description":"Specifies whether to use color in diagnostic messages. Possible values are always , auto and never .","name":"PG_COLOR"}],"options":[{"description":"Specifies the directory where the database cluster is stored.","names":["-D directory","--pgdata= directory"],"signature":"-D directory --pgdata= directory"},{"description":"Checks checksums. This is the default mode if nothing else is specified.","names":["-c","--check"],"signature":"-c --check"},{"description":"Disables checksums.","names":["-d","--disable"],"signature":"-d --disable"},{"description":"Enables checksums.","names":["-e","--enable"],"signature":"-e --enable"},{"description":"Only validate checksums in the relation with filenode filenode .","names":["-f filenode","--filenode= filenode"],"signature":"-f filenode --filenode= filenode"},{"description":"By default, pg_checksums will wait for all files to be written safely to disk. This option causes pg_checksums to 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 .","names":["-N","--no-sync"],"signature":"-N --no-sync"},{"description":"Enable progress reporting. Turning this on will deliver a progress report while checking or enabling checksums.","names":["-P","--progress"],"signature":"-P --progress"},{"description":"When set to fsync , which is the default, pg_checksums will recursively open and synchronize all files in the data directory. The search for files will follow symbolic links for the WAL directory and each configured tablespace. On Linux, syncfs may be used instead to ask the operating system to synchronize the whole file systems that contain the data directory, the WAL files, and each tablespace. See recovery_init_sync_method for information about the caveats to be aware of when using syncfs . This option has no effect when --no-sync is used.","names":["--sync-method= method"],"signature":"--sync-method= method"},{"description":"Enable verbose output. Lists all checked files.","names":["-v","--verbose"],"signature":"-v --verbose"},{"description":"Print the pg_checksums version and exit.","names":["-V","--version"],"signature":"-V --version"},{"description":"Show help about pg_checksums command line arguments, and exit.","names":["-?","--help"],"signature":"-? --help"}],"synopsis":["pg_checksums [ option ...] [[ -D | --pgdata ] datadir ]"]},"comparison_hash":"9df98d0a65050d461414d0c4fc42b1f97bbb808ec68690d4aad884d9b571bb05","description":["pg_checksums — enable, disable or check data checksums in a PostgreSQL database cluster"],"environment":[{"description":"Specifies the directory where the database cluster is stored; can be overridden using the -D option.","name":"PGDATA"},{"description":"Specifies whether to use color in diagnostic messages. Possible values are always , auto and never .","name":"PG_COLOR"}],"facts":[{"label":"Documented executable","value":"pg_checksums"},{"label":"Executable version","value":"18.6"},{"label":"Reference inventory","value":"Server applications"},{"label":"Option definition groups","value":"11"}],"manual_html":"\u003cdiv\u003e\u003cdiv class=\"refentry\" id=\"APP-PGCHECKSUMS\"\u003e\n\u003cdiv class=\"titlepage\"\u003e\u003c/div\u003e\n\u003cdiv class=\"refnamediv\"\u003e\n\u003ch2\u003e\u003cspan class=\"refentrytitle\"\u003e\u003cspan class=\"application\"\u003epg_checksums\u003c/span\u003e\u003c/span\u003e\u003c/h2\u003e\n\u003cp\u003epg_checksums — enable, disable or check data checksums in a \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e database cluster\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsynopsisdiv\"\u003e\n\u003ch2\u003eSynopsis\u003c/h2\u003e\n\u003cdiv class=\"cmdsynopsis\"\u003e\n\u003cp id=\"id-1.9.5.5.4.1\"\u003e\u003ccode class=\"command\"\u003epg_checksums\u003c/code\u003e [\u003cem class=\"replaceable\"\u003e\u003ccode\u003eoption\u003c/code\u003e\u003c/em\u003e...] [[ \u003ccode class=\"option\"\u003e-D\u003c/code\u003e | \u003ccode class=\"option\"\u003e--pgdata\u003c/code\u003e ]\u003cem class=\"replaceable\"\u003e\u003ccode\u003edatadir\u003c/code\u003e\u003c/em\u003e]\u003c/p\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"R1-APP-PGCHECKSUMS-1\"\u003e\n\u003ch2\u003eDescription\u003c/h2\u003e\n\u003cp\u003e\u003cspan class=\"application\"\u003epg_checksums\u003c/span\u003e checks, enables or disables data checksums in a \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e cluster. The server must be shut down cleanly before running \u003cspan class=\"application\"\u003epg_checksums\u003c/span\u003e. 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.\u003c/p\u003e\n\u003cp\u003eWhen verifying checksums, every file in the cluster is scanned. When enabling checksums, each relation file block with a changed checksum is rewritten in-place. Disabling checksums only updates the file \u003ccode class=\"filename\"\u003epg_control\u003c/code\u003e.\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"id-1.9.5.5.6\"\u003e\n\u003ch2\u003eOptions\u003c/h2\u003e\n\u003cp\u003eThe following command-line options are available:\u003c/p\u003e\n\u003cdiv class=\"variablelist\"\u003e\n\u003cdl class=\"variablelist\"\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-D \u003cem class=\"replaceable\"\u003e\u003ccode\u003edirectory\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--pgdata=\u003cem class=\"replaceable\"\u003e\u003ccode\u003edirectory\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies the directory where the database cluster is stored.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-c\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--check\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eChecks checksums. This is the default mode if nothing else is specified.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-d\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--disable\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDisables checksums.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--enable\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eEnables checksums.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-f \u003cem class=\"replaceable\"\u003e\u003ccode\u003efilenode\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--filenode=\u003cem class=\"replaceable\"\u003e\u003ccode\u003efilenode\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eOnly validate checksums in the relation with filenode \u003cem class=\"replaceable\"\u003e\u003ccode\u003efilenode\u003c/code\u003e\u003c/em\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-N\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--no-sync\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eBy default, \u003ccode class=\"command\"\u003epg_checksums\u003c/code\u003e will wait for all files to be written safely to disk. This option causes \u003ccode class=\"command\"\u003epg_checksums\u003c/code\u003e to 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 \u003ccode class=\"literal\"\u003e--check\u003c/code\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-P\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--progress\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eEnable progress reporting. Turning this on will deliver a progress report while checking or enabling checksums.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--sync-method=\u003cem class=\"replaceable\"\u003e\u003ccode\u003emethod\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eWhen set to \u003ccode class=\"literal\"\u003efsync\u003c/code\u003e, which is the default, \u003ccode class=\"command\"\u003epg_checksums\u003c/code\u003e will recursively open and synchronize all files in the data directory. The search for files will follow symbolic links for the WAL directory and each configured tablespace.\u003c/p\u003e\n\u003cp\u003eOn Linux, \u003ccode class=\"literal\"\u003esyncfs\u003c/code\u003e may be used instead to ask the operating system to synchronize the whole file systems that contain the data directory, the WAL files, and each tablespace. See \u003ca class=\"xref\" href=\"/docs/18/runtime-config-error-handling.html#GUC-RECOVERY-INIT-SYNC-METHOD\"\u003erecovery_init_sync_method\u003c/a\u003e for information about the caveats to be aware of when using \u003ccode class=\"literal\"\u003esyncfs\u003c/code\u003e.\u003c/p\u003e\n\u003cp\u003eThis option has no effect when \u003ccode class=\"option\"\u003e--no-sync\u003c/code\u003e is used.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-v\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--verbose\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eEnable verbose output. Lists all checked files.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-V\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--version\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint the \u003cspan class=\"application\"\u003epg_checksums\u003c/span\u003e version and exit.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-?\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--help\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eShow help about \u003cspan class=\"application\"\u003epg_checksums\u003c/span\u003e command line arguments, and exit.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"id-1.9.5.5.7\"\u003e\n\u003ch2\u003eEnvironment\u003c/h2\u003e\n\u003cdiv class=\"variablelist\"\u003e\n\u003cdl class=\"variablelist\"\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"envar\"\u003ePGDATA\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies the directory where the database cluster is stored; can be overridden using the \u003ccode class=\"option\"\u003e-D\u003c/code\u003e option.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"envar\"\u003ePG_COLOR\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies whether to use color in diagnostic messages. Possible values are \u003ccode class=\"literal\"\u003ealways\u003c/code\u003e, \u003ccode class=\"literal\"\u003eauto\u003c/code\u003e and \u003ccode class=\"literal\"\u003enever\u003c/code\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"id-1.9.5.5.8\"\u003e\n\u003ch2\u003eNotes\u003c/h2\u003e\n\u003cp\u003eEnabling 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.\u003c/p\u003e\n\u003cp\u003eWhen using a replication setup with tools which perform direct copies of relation file blocks (for example \u003ca class=\"xref\" href=\"/docs/18/app-pgrewind.html\" title=\"pg_rewind\"\u003e\u003cspan class=\"refentrytitle\"\u003e\u003cspan class=\"application\"\u003epg_rewind\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e), 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.\u003c/p\u003e\n\u003cp\u003eIf \u003cspan class=\"application\"\u003epg_checksums\u003c/span\u003e is aborted or killed while enabling or disabling checksums, the cluster's data checksum configuration remains unchanged, and \u003cspan class=\"application\"\u003epg_checksums\u003c/span\u003e can be re-run to perform the same operation.\u003c/p\u003e\n\u003c/div\u003e\n\u003c/div\u003e\u003c/div\u003e","manual_path":"app-pgchecksums.html","options":[{"description":"Specifies the directory where the database cluster is stored.","names":["-D directory","--pgdata= directory"],"signature":"-D directory --pgdata= directory","source_url":"/docs/18/app-pgchecksums.html","summary":"Specifies the directory where the database cluster is stored."},{"description":"Checks checksums. This is the default mode if nothing else is specified.","names":["-c","--check"],"signature":"-c --check","source_url":"/docs/18/app-pgchecksums.html","summary":"Checks checksums. This is the default mode if nothing else is specified."},{"description":"Disables checksums.","names":["-d","--disable"],"signature":"-d --disable","source_url":"/docs/18/app-pgchecksums.html","summary":"Disables checksums."},{"description":"Enables checksums.","names":["-e","--enable"],"signature":"-e --enable","source_url":"/docs/18/app-pgchecksums.html","summary":"Enables checksums."},{"description":"Only validate checksums in the relation with filenode filenode .","names":["-f filenode","--filenode= filenode"],"signature":"-f filenode --filenode= filenode","source_url":"/docs/18/app-pgchecksums.html","summary":"Only validate checksums in the relation with filenode filenode ."},{"description":"By default, pg_checksums will wait for all files to be written safely to disk. This option causes pg_checksums to 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 .","names":["-N","--no-sync"],"signature":"-N --no-sync","source_url":"/docs/18/app-pgchecksums.html","summary":"By default, pg_checksums will wait for all files to be written safely to disk. This option causes pg_checksums to 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 ."},{"description":"Enable progress reporting. Turning this on will deliver a progress report while checking or enabling checksums.","names":["-P","--progress"],"signature":"-P --progress","source_url":"/docs/18/app-pgchecksums.html","summary":"Enable progress reporting. Turning this on will deliver a progress report while checking or enabling checksums."},{"description":"When set to fsync , which is the default, pg_checksums will recursively open and synchronize all files in the data directory. The search for files will follow symbolic links for the WAL directory and each configured tablespace. On Linux, syncfs may be used instead to ask the operating system to synchronize the whole file systems that contain the data directory, the WAL files, and each tablespace. See recovery_init_sync_method for information about the caveats to be aware of when using syncfs . This option has no effect when --no-sync is used.","names":["--sync-method= method"],"signature":"--sync-method= method","source_url":"/docs/18/app-pgchecksums.html","summary":"When set to fsync , which is the default, pg_checksums will recursively open and synchronize all files in the data directory. The search for files will follow symbolic links for the WAL directory and each configured tablespace."},{"description":"Enable verbose output. Lists all checked files.","names":["-v","--verbose"],"signature":"-v --verbose","source_url":"/docs/18/app-pgchecksums.html","summary":"Enable verbose output. Lists all checked files."},{"description":"Print the pg_checksums version and exit.","names":["-V","--version"],"signature":"-V --version","source_url":"/docs/18/app-pgchecksums.html","summary":"Print the pg_checksums version and exit."},{"description":"Show help about pg_checksums command line arguments, and exit.","names":["-?","--help"],"signature":"-? --help","source_url":"/docs/18/app-pgchecksums.html","summary":"Show help about pg_checksums command line arguments, and exit."}],"related":[],"release":{"channel":"stable","evidence_kind":"English manual and source declarations","label":"18.6","major":"18","manifest":{"index":"index.html","major":"18","pages":1148,"pdf":{"A4":{"built_at":"2026-09-26","bytes":15865106,"pages":3154,"sha256":"19512c405da53f9f7fcf0abba359223aa65f021be025bf3411381918f92e3190","url":"/files/documentation/pdf/18/postgresql-18-A4.pdf"},"US":{"built_at":"2026-09-26","bytes":15748059,"pages":3328,"sha256":"facbe6c229e598b872d3d98bef53308f46e06746006fa4590de9a7de9dd46319","url":"/files/documentation/pdf/18/postgresql-18-US.pdf"}},"release":"18.6","source_mode":"en SGML built with pinned official archive","source_sha256":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","source_url":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2","svg_assets":3,"tree":"18"},"ref":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2","revision":"ee8d1a3612338fd9adf250730cb640fcc5233b5491337cc00a316a44e3a0b9f8","source_sha256":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f"},"sections":[],"signature":"pg_checksums [ option ...] [[ -D | --pgdata ] datadir ]","sources":[{"anchor":"","file":"app-pgchecksums.html","label":"18.6 English manual · app-pgchecksums.html","sha256":"b16216257df55c09f6cc76f43a9c8ac811fda49b3a4490608f936681aa3cd4c2","url":"/docs/18/app-pgchecksums.html"},{"anchor":"","file":"reference-server.html","label":"Server applications inventory","sha256":"e9f8bbcc8e3641fadd1d20991e8aad6b532155b786ba5a1b7b364ec4f1a5bef3","url":"/docs/18/reference-server.html"}],"synopsis":["pg_checksums [ option ...] [[ -D | --pgdata ] datadir ]"],"tables":[{"columns":[{"key":"signature","label":"Option and arguments"},{"key":"summary","label":"Description"}],"key":"options","rows":[{"signature":{"text":"-D directory --pgdata= directory","url":"/docs/18/app-pgchecksums.html"},"summary":"Specifies the directory where the database cluster is stored."},{"signature":{"text":"-c --check","url":"/docs/18/app-pgchecksums.html"},"summary":"Checks checksums. This is the default mode if nothing else is specified."},{"signature":{"text":"-d --disable","url":"/docs/18/app-pgchecksums.html"},"summary":"Disables checksums."},{"signature":{"text":"-e --enable","url":"/docs/18/app-pgchecksums.html"},"summary":"Enables checksums."},{"signature":{"text":"-f filenode --filenode= filenode","url":"/docs/18/app-pgchecksums.html"},"summary":"Only validate checksums in the relation with filenode filenode ."},{"signature":{"text":"-N --no-sync","url":"/docs/18/app-pgchecksums.html"},"summary":"By default, pg_checksums will wait for all files to be written safely to disk. This option causes pg_checksums to 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 ."},{"signature":{"text":"-P --progress","url":"/docs/18/app-pgchecksums.html"},"summary":"Enable progress reporting. Turning this on will deliver a progress report while checking or enabling checksums."},{"signature":{"text":"--sync-method= method","url":"/docs/18/app-pgchecksums.html"},"summary":"When set to fsync , which is the default, pg_checksums will recursively open and synchronize all files in the data directory. The search for files will follow symbolic links for the WAL directory and each configured tablespace."},{"signature":{"text":"-v --verbose","url":"/docs/18/app-pgchecksums.html"},"summary":"Enable verbose output. Lists all checked files."},{"signature":{"text":"-V --version","url":"/docs/18/app-pgchecksums.html"},"summary":"Print the pg_checksums version and exit."},{"signature":{"text":"-? --help","url":"/docs/18/app-pgchecksums.html"},"summary":"Show help about pg_checksums command line arguments, and exit."}],"title":"Documented options"},{"columns":[{"key":"name","label":"Variable"},{"key":"description","label":"Meaning"}],"key":"environment","rows":[{"description":"Specifies the directory where the database cluster is stored; can be overridden using the -D option.","name":"PGDATA"},{"description":"Specifies whether to use color in diagnostic messages. Possible values are always , auto and never .","name":"PG_COLOR"}],"title":"Environment variables"}]},"ManualEvidence":{"manual_path":"app-pgchecksums.html","release":{"channel":"stable","evidence_kind":"English manual and source declarations","label":"18.6","major":"18","manifest":{"index":"index.html","major":"18","pages":1148,"pdf":{"A4":{"built_at":"2026-09-26","bytes":15865106,"pages":3154,"sha256":"19512c405da53f9f7fcf0abba359223aa65f021be025bf3411381918f92e3190","url":"/files/documentation/pdf/18/postgresql-18-A4.pdf"},"US":{"built_at":"2026-09-26","bytes":15748059,"pages":3328,"sha256":"facbe6c229e598b872d3d98bef53308f46e06746006fa4590de9a7de9dd46319","url":"/files/documentation/pdf/18/postgresql-18-US.pdf"}},"release":"18.6","source_mode":"en SGML built with pinned official archive","source_sha256":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","source_url":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2","svg_assets":3,"tree":"18"},"ref":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2","revision":"ee8d1a3612338fd9adf250730cb640fcc5233b5491337cc00a316a44e3a0b9f8","source_sha256":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f"},"sources":[{"anchor":"","file":"app-pgchecksums.html","label":"18.6 English manual · app-pgchecksums.html","sha256":"b16216257df55c09f6cc76f43a9c8ac811fda49b3a4490608f936681aa3cd4c2","url":"/docs/18/app-pgchecksums.html"},{"anchor":"","file":"reference-server.html","label":"Server applications inventory","sha256":"e9f8bbcc8e3641fadd1d20991e8aad6b532155b786ba5a1b7b364ec4f1a5bef3","url":"/docs/18/reference-server.html"}]},"MeasuredEvidence":{}},"Text":{"Collection":"tool","Key":"pg-checksums","SourceDatabase":"center","Version":"18","Locale":"en","Title":"pg_checksums","Summary":"pg_checksums — enable, disable or check data checksums in a PostgreSQL database cluster","BodyHTML":"\u003cdiv\u003e\u003cdiv id=\"APP-PGCHECKSUMS\"\u003e\n\u003cdiv\u003e\u003c/div\u003e\n\u003cdiv\u003e\n\u003ch2\u003e\u003cspan\u003e\u003cspan\u003epg_checksums\u003c/span\u003e\u003c/span\u003e\u003c/h2\u003e\n\u003cp\u003epg_checksums — enable, disable or check data checksums in a \u003cspan\u003ePostgreSQL\u003c/span\u003e database cluster\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv\u003e\n\u003ch2\u003eSynopsis\u003c/h2\u003e\n\u003cdiv\u003e\n\u003cp id=\"id-1.9.5.5.4.1\"\u003e\u003ccode\u003epg_checksums\u003c/code\u003e [\u003cem\u003e\u003ccode\u003eoption\u003c/code\u003e\u003c/em\u003e...] [[ \u003ccode\u003e-D\u003c/code\u003e | \u003ccode\u003e--pgdata\u003c/code\u003e ]\u003cem\u003e\u003ccode\u003edatadir\u003c/code\u003e\u003c/em\u003e]\u003c/p\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cdiv id=\"R1-APP-PGCHECKSUMS-1\"\u003e\n\u003ch2\u003eDescription\u003c/h2\u003e\n\u003cp\u003e\u003cspan\u003epg_checksums\u003c/span\u003e checks, enables or disables data checksums in a \u003cspan\u003ePostgreSQL\u003c/span\u003e cluster. The server must be shut down cleanly before running \u003cspan\u003epg_checksums\u003c/span\u003e. 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.\u003c/p\u003e\n\u003cp\u003eWhen verifying checksums, every file in the cluster is scanned. When enabling checksums, each relation file block with a changed checksum is rewritten in-place. Disabling checksums only updates the file \u003ccode\u003epg_control\u003c/code\u003e.\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv id=\"id-1.9.5.5.6\"\u003e\n\u003ch2\u003eOptions\u003c/h2\u003e\n\u003cp\u003eThe following command-line options are available:\u003c/p\u003e\n\u003cdiv\u003e\n\u003cdl\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-D \u003cem\u003e\u003ccode\u003edirectory\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--pgdata=\u003cem\u003e\u003ccode\u003edirectory\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies the directory where the database cluster is stored.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-c\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--check\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eChecks checksums. This is the default mode if nothing else is specified.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-d\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--disable\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDisables checksums.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--enable\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eEnables checksums.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-f \u003cem\u003e\u003ccode\u003efilenode\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--filenode=\u003cem\u003e\u003ccode\u003efilenode\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eOnly validate checksums in the relation with filenode \u003cem\u003e\u003ccode\u003efilenode\u003c/code\u003e\u003c/em\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-N\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--no-sync\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eBy default, \u003ccode\u003epg_checksums\u003c/code\u003e will wait for all files to be written safely to disk. This option causes \u003ccode\u003epg_checksums\u003c/code\u003e to 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 \u003ccode\u003e--check\u003c/code\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-P\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--progress\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eEnable progress reporting. Turning this on will deliver a progress report while checking or enabling checksums.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--sync-method=\u003cem\u003e\u003ccode\u003emethod\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eWhen set to \u003ccode\u003efsync\u003c/code\u003e, which is the default, \u003ccode\u003epg_checksums\u003c/code\u003e will recursively open and synchronize all files in the data directory. The search for files will follow symbolic links for the WAL directory and each configured tablespace.\u003c/p\u003e\n\u003cp\u003eOn Linux, \u003ccode\u003esyncfs\u003c/code\u003e may be used instead to ask the operating system to synchronize the whole file systems that contain the data directory, the WAL files, and each tablespace. See \u003ca href=\"/docs/18/runtime-config-error-handling.html#GUC-RECOVERY-INIT-SYNC-METHOD\" rel=\"nofollow\"\u003erecovery_init_sync_method\u003c/a\u003e for information about the caveats to be aware of when using \u003ccode\u003esyncfs\u003c/code\u003e.\u003c/p\u003e\n\u003cp\u003eThis option has no effect when \u003ccode\u003e--no-sync\u003c/code\u003e is used.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-v\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--verbose\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eEnable verbose output. Lists all checked files.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-V\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--version\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint the \u003cspan\u003epg_checksums\u003c/span\u003e version and exit.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-?\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--help\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eShow help about \u003cspan\u003epg_checksums\u003c/span\u003e command line arguments, and exit.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cdiv id=\"id-1.9.5.5.7\"\u003e\n\u003ch2\u003eEnvironment\u003c/h2\u003e\n\u003cdiv\u003e\n\u003cdl\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003ePGDATA\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies the directory where the database cluster is stored; can be overridden using the \u003ccode\u003e-D\u003c/code\u003e option.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003ePG_COLOR\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies whether to use color in diagnostic messages. Possible values are \u003ccode\u003ealways\u003c/code\u003e, \u003ccode\u003eauto\u003c/code\u003e and \u003ccode\u003enever\u003c/code\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cdiv id=\"id-1.9.5.5.8\"\u003e\n\u003ch2\u003eNotes\u003c/h2\u003e\n\u003cp\u003eEnabling 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.\u003c/p\u003e\n\u003cp\u003eWhen using a replication setup with tools which perform direct copies of relation file blocks (for example \u003ca href=\"/docs/18/app-pgrewind.html\" title=\"pg_rewind\" rel=\"nofollow\"\u003e\u003cspan\u003e\u003cspan\u003epg_rewind\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e), 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.\u003c/p\u003e\n\u003cp\u003eIf \u003cspan\u003epg_checksums\u003c/span\u003e is aborted or killed while enabling or disabling checksums, the cluster\u0026#39;s data checksum configuration remains unchanged, and \u003cspan\u003epg_checksums\u003c/span\u003e can be re-run to perform the same operation.\u003c/p\u003e\n\u003c/div\u003e\n\u003c/div\u003e\u003c/div\u003e","SourceRevision":"ee8d1a3612338fd9adf250730cb640fcc5233b5491337cc00a316a44e3a0b9f8","ContentHash":"7c58394273904c51fde52b8f2bba9bd8c29592668052c424671ce22a34acc1d4","Payload":{"description":["pg_checksums — enable, disable or check data checksums in a PostgreSQL database cluster"],"manual_html":"\u003cdiv\u003e\u003cdiv class=\"refentry\" id=\"APP-PGCHECKSUMS\"\u003e\n\u003cdiv class=\"titlepage\"\u003e\u003c/div\u003e\n\u003cdiv class=\"refnamediv\"\u003e\n\u003ch2\u003e\u003cspan class=\"refentrytitle\"\u003e\u003cspan class=\"application\"\u003epg_checksums\u003c/span\u003e\u003c/span\u003e\u003c/h2\u003e\n\u003cp\u003epg_checksums — enable, disable or check data checksums in a \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e database cluster\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsynopsisdiv\"\u003e\n\u003ch2\u003eSynopsis\u003c/h2\u003e\n\u003cdiv class=\"cmdsynopsis\"\u003e\n\u003cp id=\"id-1.9.5.5.4.1\"\u003e\u003ccode class=\"command\"\u003epg_checksums\u003c/code\u003e [\u003cem class=\"replaceable\"\u003e\u003ccode\u003eoption\u003c/code\u003e\u003c/em\u003e...] [[ \u003ccode class=\"option\"\u003e-D\u003c/code\u003e | \u003ccode class=\"option\"\u003e--pgdata\u003c/code\u003e ]\u003cem class=\"replaceable\"\u003e\u003ccode\u003edatadir\u003c/code\u003e\u003c/em\u003e]\u003c/p\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"R1-APP-PGCHECKSUMS-1\"\u003e\n\u003ch2\u003eDescription\u003c/h2\u003e\n\u003cp\u003e\u003cspan class=\"application\"\u003epg_checksums\u003c/span\u003e checks, enables or disables data checksums in a \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e cluster. The server must be shut down cleanly before running \u003cspan class=\"application\"\u003epg_checksums\u003c/span\u003e. 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.\u003c/p\u003e\n\u003cp\u003eWhen verifying checksums, every file in the cluster is scanned. When enabling checksums, each relation file block with a changed checksum is rewritten in-place. Disabling checksums only updates the file \u003ccode class=\"filename\"\u003epg_control\u003c/code\u003e.\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"id-1.9.5.5.6\"\u003e\n\u003ch2\u003eOptions\u003c/h2\u003e\n\u003cp\u003eThe following command-line options are available:\u003c/p\u003e\n\u003cdiv class=\"variablelist\"\u003e\n\u003cdl class=\"variablelist\"\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-D \u003cem class=\"replaceable\"\u003e\u003ccode\u003edirectory\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--pgdata=\u003cem class=\"replaceable\"\u003e\u003ccode\u003edirectory\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies the directory where the database cluster is stored.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-c\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--check\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eChecks checksums. This is the default mode if nothing else is specified.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-d\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--disable\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDisables checksums.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--enable\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eEnables checksums.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-f \u003cem class=\"replaceable\"\u003e\u003ccode\u003efilenode\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--filenode=\u003cem class=\"replaceable\"\u003e\u003ccode\u003efilenode\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eOnly validate checksums in the relation with filenode \u003cem class=\"replaceable\"\u003e\u003ccode\u003efilenode\u003c/code\u003e\u003c/em\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-N\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--no-sync\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eBy default, \u003ccode class=\"command\"\u003epg_checksums\u003c/code\u003e will wait for all files to be written safely to disk. This option causes \u003ccode class=\"command\"\u003epg_checksums\u003c/code\u003e to 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 \u003ccode class=\"literal\"\u003e--check\u003c/code\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-P\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--progress\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eEnable progress reporting. Turning this on will deliver a progress report while checking or enabling checksums.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--sync-method=\u003cem class=\"replaceable\"\u003e\u003ccode\u003emethod\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eWhen set to \u003ccode class=\"literal\"\u003efsync\u003c/code\u003e, which is the default, \u003ccode class=\"command\"\u003epg_checksums\u003c/code\u003e will recursively open and synchronize all files in the data directory. The search for files will follow symbolic links for the WAL directory and each configured tablespace.\u003c/p\u003e\n\u003cp\u003eOn Linux, \u003ccode class=\"literal\"\u003esyncfs\u003c/code\u003e may be used instead to ask the operating system to synchronize the whole file systems that contain the data directory, the WAL files, and each tablespace. See \u003ca class=\"xref\" href=\"/docs/18/runtime-config-error-handling.html#GUC-RECOVERY-INIT-SYNC-METHOD\"\u003erecovery_init_sync_method\u003c/a\u003e for information about the caveats to be aware of when using \u003ccode class=\"literal\"\u003esyncfs\u003c/code\u003e.\u003c/p\u003e\n\u003cp\u003eThis option has no effect when \u003ccode class=\"option\"\u003e--no-sync\u003c/code\u003e is used.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-v\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--verbose\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eEnable verbose output. Lists all checked files.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-V\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--version\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint the \u003cspan class=\"application\"\u003epg_checksums\u003c/span\u003e version and exit.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-?\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--help\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eShow help about \u003cspan class=\"application\"\u003epg_checksums\u003c/span\u003e command line arguments, and exit.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"id-1.9.5.5.7\"\u003e\n\u003ch2\u003eEnvironment\u003c/h2\u003e\n\u003cdiv class=\"variablelist\"\u003e\n\u003cdl class=\"variablelist\"\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"envar\"\u003ePGDATA\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies the directory where the database cluster is stored; can be overridden using the \u003ccode class=\"option\"\u003e-D\u003c/code\u003e option.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"envar\"\u003ePG_COLOR\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies whether to use color in diagnostic messages. Possible values are \u003ccode class=\"literal\"\u003ealways\u003c/code\u003e, \u003ccode class=\"literal\"\u003eauto\u003c/code\u003e and \u003ccode class=\"literal\"\u003enever\u003c/code\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"id-1.9.5.5.8\"\u003e\n\u003ch2\u003eNotes\u003c/h2\u003e\n\u003cp\u003eEnabling 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.\u003c/p\u003e\n\u003cp\u003eWhen using a replication setup with tools which perform direct copies of relation file blocks (for example \u003ca class=\"xref\" href=\"/docs/18/app-pgrewind.html\" title=\"pg_rewind\"\u003e\u003cspan class=\"refentrytitle\"\u003e\u003cspan class=\"application\"\u003epg_rewind\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e), 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.\u003c/p\u003e\n\u003cp\u003eIf \u003cspan class=\"application\"\u003epg_checksums\u003c/span\u003e is aborted or killed while enabling or disabling checksums, the cluster's data checksum configuration remains unchanged, and \u003cspan class=\"application\"\u003epg_checksums\u003c/span\u003e can be re-run to perform the same operation.\u003c/p\u003e\n\u003c/div\u003e\n\u003c/div\u003e\u003c/div\u003e","related":[],"sections":[],"tables":[{"columns":[{"key":"signature","label":"Option and arguments"},{"key":"summary","label":"Description"}],"key":"options","rows":[{"signature":{"text":"-D directory --pgdata= directory","url":"/docs/18/app-pgchecksums.html"},"summary":"Specifies the directory where the database cluster is stored."},{"signature":{"text":"-c --check","url":"/docs/18/app-pgchecksums.html"},"summary":"Checks checksums. This is the default mode if nothing else is specified."},{"signature":{"text":"-d --disable","url":"/docs/18/app-pgchecksums.html"},"summary":"Disables checksums."},{"signature":{"text":"-e --enable","url":"/docs/18/app-pgchecksums.html"},"summary":"Enables checksums."},{"signature":{"text":"-f filenode --filenode= filenode","url":"/docs/18/app-pgchecksums.html"},"summary":"Only validate checksums in the relation with filenode filenode ."},{"signature":{"text":"-N --no-sync","url":"/docs/18/app-pgchecksums.html"},"summary":"By default, pg_checksums will wait for all files to be written safely to disk. This option causes pg_checksums to 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 ."},{"signature":{"text":"-P --progress","url":"/docs/18/app-pgchecksums.html"},"summary":"Enable progress reporting. Turning this on will deliver a progress report while checking or enabling checksums."},{"signature":{"text":"--sync-method= method","url":"/docs/18/app-pgchecksums.html"},"summary":"When set to fsync , which is the default, pg_checksums will recursively open and synchronize all files in the data directory. The search for files will follow symbolic links for the WAL directory and each configured tablespace."},{"signature":{"text":"-v --verbose","url":"/docs/18/app-pgchecksums.html"},"summary":"Enable verbose output. Lists all checked files."},{"signature":{"text":"-V --version","url":"/docs/18/app-pgchecksums.html"},"summary":"Print the pg_checksums version and exit."},{"signature":{"text":"-? --help","url":"/docs/18/app-pgchecksums.html"},"summary":"Show help about pg_checksums command line arguments, and exit."}],"title":"Documented options"},{"columns":[{"key":"name","label":"Variable"},{"key":"description","label":"Meaning"}],"key":"environment","rows":[{"description":"Specifies the directory where the database cluster is stored; can be overridden using the -D option.","name":"PGDATA"},{"description":"Specifies whether to use color in diagnostic messages. Possible values are always , auto and never .","name":"PG_COLOR"}],"title":"Environment variables"}]}},"RequestedLocale":"zh-Hans","Fallback":true,"Versions":["12","13","14","15","16","17","18","19","20"],"Locales":["en"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
