{"kind": "tool", "major": "18", "item": {"slug": "pg-checksums", "name": "pg_checksums", "name_zh": "", "category": "Server applications", "summary": "pg_checksums \u2014 enable, disable or check data checksums in a PostgreSQL database cluster", "aliases": ["pg_checksums"], "content_hash": "66b6d0a99982350e948adee238f9c25b29aef70d8455235184b771718a1b703d", "versions": {"12": {"facts": [{"label": "Documented executable", "value": "pg_checksums"}, {"label": "Executable version", "value": "12.22"}, {"label": "Reference inventory", "value": "Server applications"}, {"label": "Option definition groups", "value": "10"}], "tables": [{"key": "options", "rows": [{"summary": "Specifies the directory where the database cluster is stored.", "signature": {"url": "/docs/12/app-pgchecksums.html", "text": "-D directory --pgdata= directory"}}, {"summary": "Checks checksums. This is the default mode if nothing else is specified.", "signature": {"url": "/docs/12/app-pgchecksums.html", "text": "-c --check"}}, {"summary": "Disables checksums.", "signature": {"url": "/docs/12/app-pgchecksums.html", "text": "-d --disable"}}, {"summary": "Enables checksums.", "signature": {"url": "/docs/12/app-pgchecksums.html", "text": "-e --enable"}}, {"summary": "Only validate checksums in the relation with filenode filenode .", "signature": {"url": "/docs/12/app-pgchecksums.html", "text": "-f filenode --filenode= filenode"}}, {"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": {"url": "/docs/12/app-pgchecksums.html", "text": "-N --no-sync"}}, {"summary": "Enable progress reporting. Turning this on will deliver a progress report while checking or enabling checksums.", "signature": {"url": "/docs/12/app-pgchecksums.html", "text": "-P --progress"}}, {"summary": "Enable verbose output. Lists all checked files.", "signature": {"url": "/docs/12/app-pgchecksums.html", "text": "-v --verbose"}}, {"summary": "Print the pg_checksums version and exit.", "signature": {"url": "/docs/12/app-pgchecksums.html", "text": "-V --version"}}, {"summary": "Show help about pg_checksums command line arguments, and exit.", "signature": {"url": "/docs/12/app-pgchecksums.html", "text": "-? --help"}}], "title": "Documented options", "columns": [{"key": "signature", "label": "Option and arguments"}, {"key": "summary", "label": "Description"}]}, {"key": "environment", "rows": [{"name": "PGDATA", "description": "Specifies the directory where the database cluster is stored; can be overridden using the -D option."}, {"name": "PG_COLOR", "description": "Specifies whether to use color in diagnostic messages. Possible values are always , auto and never ."}], "title": "Environment variables", "columns": [{"key": "name", "label": "Variable"}, {"key": "description", "label": "Meaning"}]}], "options": [{"names": ["-D directory", "--pgdata= directory"], "summary": "Specifies the directory where the database cluster is stored.", "signature": "-D directory --pgdata= directory", "source_url": "/docs/12/app-pgchecksums.html", "description": "Specifies the directory where the database cluster is stored."}, {"names": ["-c", "--check"], "summary": "Checks checksums. This is the default mode if nothing else is specified.", "signature": "-c --check", "source_url": "/docs/12/app-pgchecksums.html", "description": "Checks checksums. This is the default mode if nothing else is specified."}, {"names": ["-d", "--disable"], "summary": "Disables checksums.", "signature": "-d --disable", "source_url": "/docs/12/app-pgchecksums.html", "description": "Disables checksums."}, {"names": ["-e", "--enable"], "summary": "Enables checksums.", "signature": "-e --enable", "source_url": "/docs/12/app-pgchecksums.html", "description": "Enables checksums."}, {"names": ["-f filenode", "--filenode= filenode"], "summary": "Only validate checksums in the relation with filenode filenode .", "signature": "-f filenode --filenode= filenode", "source_url": "/docs/12/app-pgchecksums.html", "description": "Only validate checksums in the relation with filenode filenode ."}, {"names": ["-N", "--no-sync"], "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": "-N --no-sync", "source_url": "/docs/12/app-pgchecksums.html", "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": ["-P", "--progress"], "summary": "Enable progress reporting. Turning this on will deliver a progress report while checking or enabling checksums.", "signature": "-P --progress", "source_url": "/docs/12/app-pgchecksums.html", "description": "Enable progress reporting. Turning this on will deliver a progress report while checking or enabling checksums."}, {"names": ["-v", "--verbose"], "summary": "Enable verbose output. Lists all checked files.", "signature": "-v --verbose", "source_url": "/docs/12/app-pgchecksums.html", "description": "Enable verbose output. Lists all checked files."}, {"names": ["-V", "--version"], "summary": "Print the pg_checksums version and exit.", "signature": "-V --version", "source_url": "/docs/12/app-pgchecksums.html", "description": "Print the pg_checksums version and exit."}, {"names": ["-?", "--help"], "summary": "Show help about pg_checksums command line arguments, and exit.", "signature": "-? --help", "source_url": "/docs/12/app-pgchecksums.html", "description": "Show help about pg_checksums command line arguments, and exit."}], "related": [], "release": {"ref": "https://ftp.postgresql.org/pub/source/v12.22/postgresql-12.22.tar.bz2", "label": "12.22", "major": "12", "channel": "historical", "manifest": {"pdf": {"A4": {"url": "/files/documentation/pdf/12/postgresql-12-A4.pdf", "bytes": 13424351, "pages": 2803, "sha256": "7422cf53fd1939e7a3d2925231a88b0330e468afa5393627cac0ff86158a0621", "built_at": "2026-09-26"}, "US": {"url": "/files/documentation/pdf/12/postgresql-12-US.pdf", "bytes": 13322565, "pages": 2958, "sha256": "51f3b04e72907fc38512685946223452ea65f84419c60c66241dfa3396035e77", "built_at": "2026-09-26"}}, "tree": "12", "index": "index.html", "major": "12", "pages": 1131, "release": "12.22", "source_url": "https://ftp.postgresql.org/pub/source/v12.22/postgresql-12.22.tar.bz2", "svg_assets": 2, "source_mode": "en HTML verified against the pinned official archive", "source_sha256": "8df3c0474782589d3c6f374b5133b1bd14d168086edbc13c6e72e67dd4527a3b"}, "revision": "7a827e97cbfacd7febff75f34443e2043e40723de5b6d8c9d81a9430b65a37e4", "evidence_kind": "English manual and source declarations", "source_sha256": "8df3c0474782589d3c6f374b5133b1bd14d168086edbc13c6e72e67dd4527a3b"}, "sources": [{"url": "/docs/12/app-pgchecksums.html", "file": "app-pgchecksums.html", "label": "12.22 English manual \u00b7 app-pgchecksums.html", "anchor": "", "sha256": "227bd278a0a1c348be37b328077beac0126143b03db30c9de7bbd1b2e47cbbd6"}, {"url": "/docs/12/reference-server.html", "file": "reference-server.html", "label": "Server applications inventory", "anchor": "", "sha256": "7f6ae1fadc1b0bffa606551460e62aacdc2508a3fb66566ddae861928ca6080b"}], "sections": [], "synopsis": ["pg_checksums [ option ...] [[ -D | --pgdata ] datadir ]"], "signature": "pg_checksums [ option ...] [[ -D | --pgdata ] datadir ]", "description": ["pg_checksums \u2014 enable, disable or check data checksums in a PostgreSQL database cluster"], "environment": [{"name": "PGDATA", "description": "Specifies the directory where the database cluster is stored; can be overridden using the -D option."}, {"name": "PG_COLOR", "description": "Specifies whether to use color in diagnostic messages. Possible values are always , auto and never ."}], "manual_html": "<div><div class=\"refentry\" id=\"APP-PGCHECKSUMS\">\n<div class=\"titlepage\"></div>\n<div class=\"refnamediv\">\n<h2><span class=\"refentrytitle\"><span class=\"application\">pg_checksums</span></span></h2>\n<p>pg_checksums \u2014 enable, disable or check data checksums in a <span class=\"productname\">PostgreSQL</span> database cluster</p>\n</div>\n<div class=\"refsynopsisdiv\">\n<h2>Synopsis</h2>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.5.4.1\"><code class=\"command\">pg_checksums</code> [<em class=\"replaceable\"><code>option</code></em>...] [[ <code class=\"option\">-D</code> | <code class=\"option\">--pgdata</code> ]<em class=\"replaceable\"><code>datadir</code></em>]</p>\n</div>\n</div>\n<div class=\"refsect1\" id=\"R1-APP-PG_CHECKSUMS-1\">\n<h2>Description</h2>\n<p><span class=\"application\">pg_checksums</span> checks, enables or disables data checksums in a <span class=\"productname\">PostgreSQL</span> cluster. The server must be shut down cleanly before running <span class=\"application\">pg_checksums</span>. 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.</p>\n<p>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 <code class=\"filename\">pg_control</code>.</p>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.5.6\">\n<h2>Options</h2>\n<p>The following command-line options are available:</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-D <em class=\"replaceable\"><code>directory</code></em></code><br></span><span class=\"term\"><code class=\"option\">--pgdata=<em class=\"replaceable\"><code>directory</code></em></code></span></dt>\n<dd>\n<p>Specifies the directory where the database cluster is stored.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-c</code><br></span><span class=\"term\"><code class=\"option\">--check</code></span></dt>\n<dd>\n<p>Checks checksums. This is the default mode if nothing else is specified.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-d</code><br></span><span class=\"term\"><code class=\"option\">--disable</code></span></dt>\n<dd>\n<p>Disables checksums.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-e</code><br></span><span class=\"term\"><code class=\"option\">--enable</code></span></dt>\n<dd>\n<p>Enables checksums.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-f <em class=\"replaceable\"><code>filenode</code></em></code><br></span><span class=\"term\"><code class=\"option\">--filenode=<em class=\"replaceable\"><code>filenode</code></em></code></span></dt>\n<dd>\n<p>Only validate checksums in the relation with filenode <em class=\"replaceable\"><code>filenode</code></em>.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-N</code><br></span><span class=\"term\"><code class=\"option\">--no-sync</code></span></dt>\n<dd>\n<p>By default, <code class=\"command\">pg_checksums</code> will wait for all files to be written safely to disk. This option causes <code class=\"command\">pg_checksums</code> 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 <code class=\"literal\">--check</code>.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-P</code><br></span><span class=\"term\"><code class=\"option\">--progress</code></span></dt>\n<dd>\n<p>Enable progress reporting. Turning this on will deliver a progress report while checking or enabling checksums.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-v</code><br></span><span class=\"term\"><code class=\"option\">--verbose</code></span></dt>\n<dd>\n<p>Enable verbose output. Lists all checked files.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-V</code><br></span><span class=\"term\"><code class=\"option\">--version</code></span></dt>\n<dd>\n<p>Print the <span class=\"application\">pg_checksums</span> version and exit.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-?</code><br></span><span class=\"term\"><code class=\"option\">--help</code></span></dt>\n<dd>\n<p>Show help about <span class=\"application\">pg_checksums</span> command line arguments, and exit.</p>\n</dd>\n</dl>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.5.7\">\n<h2>Environment</h2>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"envar\">PGDATA</code></span></dt>\n<dd>\n<p>Specifies the directory where the database cluster is stored; can be overridden using the <code class=\"option\">-D</code> option.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"envar\">PG_COLOR</code></span></dt>\n<dd>\n<p>Specifies whether to use color in diagnostic messages. Possible values are <code class=\"literal\">always</code>, <code class=\"literal\">auto</code> and <code class=\"literal\">never</code>.</p>\n</dd>\n</dl>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.5.8\">\n<h2>Notes</h2>\n<p>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.</p>\n<p>When using a replication setup with tools which perform direct copies of relation file blocks (for example <a class=\"xref\" href=\"/docs/12/app-pgrewind.html\" title=\"pg_rewind\"><span class=\"refentrytitle\"><span class=\"application\">pg_rewind</span></span></a>), 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.</p>\n<p>If <span class=\"application\">pg_checksums</span> is aborted or killed while enabling or disabling checksums, the cluster's data checksum configuration remains unchanged, and <span class=\"application\">pg_checksums</span> can be re-run to perform the same operation.</p>\n</div>\n</div></div>", "manual_path": "app-pgchecksums.html", "comparison_data": {"options": [{"names": ["-D directory", "--pgdata= directory"], "signature": "-D directory --pgdata= directory", "description": "Specifies the directory where the database cluster is stored."}, {"names": ["-c", "--check"], "signature": "-c --check", "description": "Checks checksums. This is the default mode if nothing else is specified."}, {"names": ["-d", "--disable"], "signature": "-d --disable", "description": "Disables checksums."}, {"names": ["-e", "--enable"], "signature": "-e --enable", "description": "Enables checksums."}, {"names": ["-f filenode", "--filenode= filenode"], "signature": "-f filenode --filenode= filenode", "description": "Only validate checksums in the relation with filenode filenode ."}, {"names": ["-N", "--no-sync"], "signature": "-N --no-sync", "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": ["-P", "--progress"], "signature": "-P --progress", "description": "Enable progress reporting. Turning this on will deliver a progress report while checking or enabling checksums."}, {"names": ["-v", "--verbose"], "signature": "-v --verbose", "description": "Enable verbose output. Lists all checked files."}, {"names": ["-V", "--version"], "signature": "-V --version", "description": "Print the pg_checksums version and exit."}, {"names": ["-?", "--help"], "signature": "-? --help", "description": "Show help about pg_checksums command line arguments, and exit."}], "synopsis": ["pg_checksums [ option ...] [[ -D | --pgdata ] datadir ]"], "environment": [{"name": "PGDATA", "description": "Specifies the directory where the database cluster is stored; can be overridden using the -D option."}, {"name": "PG_COLOR", "description": "Specifies whether to use color in diagnostic messages. Possible values are always , auto and never ."}]}, "comparison_hash": "dc177d5e3b70222dba48a916063353fd7bd6e09a1784594b268608ed54ea9e7a"}, "13": {"facts": [{"label": "Documented executable", "value": "pg_checksums"}, {"label": "Executable version", "value": "13.23"}, {"label": "Reference inventory", "value": "Server applications"}, {"label": "Option definition groups", "value": "10"}], "tables": [{"key": "options", "rows": [{"summary": "Specifies the directory where the database cluster is stored.", "signature": {"url": "/docs/13/app-pgchecksums.html", "text": "-D directory --pgdata= directory"}}, {"summary": "Checks checksums. This is the default mode if nothing else is specified.", "signature": {"url": "/docs/13/app-pgchecksums.html", "text": "-c --check"}}, {"summary": "Disables checksums.", "signature": {"url": "/docs/13/app-pgchecksums.html", "text": "-d --disable"}}, {"summary": "Enables checksums.", "signature": {"url": "/docs/13/app-pgchecksums.html", "text": "-e --enable"}}, {"summary": "Only validate checksums in the relation with filenode filenode .", "signature": {"url": "/docs/13/app-pgchecksums.html", "text": "-f filenode --filenode= filenode"}}, {"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": {"url": "/docs/13/app-pgchecksums.html", "text": "-N --no-sync"}}, {"summary": "Enable progress reporting. Turning this on will deliver a progress report while checking or enabling checksums.", "signature": {"url": "/docs/13/app-pgchecksums.html", "text": "-P --progress"}}, {"summary": "Enable verbose output. Lists all checked files.", "signature": {"url": "/docs/13/app-pgchecksums.html", "text": "-v --verbose"}}, {"summary": "Print the pg_checksums version and exit.", "signature": {"url": "/docs/13/app-pgchecksums.html", "text": "-V --version"}}, {"summary": "Show help about pg_checksums command line arguments, and exit.", "signature": {"url": "/docs/13/app-pgchecksums.html", "text": "-? --help"}}], "title": "Documented options", "columns": [{"key": "signature", "label": "Option and arguments"}, {"key": "summary", "label": "Description"}]}, {"key": "environment", "rows": [{"name": "PGDATA", "description": "Specifies the directory where the database cluster is stored; can be overridden using the -D option."}, {"name": "PG_COLOR", "description": "Specifies whether to use color in diagnostic messages. Possible values are always , auto and never ."}], "title": "Environment variables", "columns": [{"key": "name", "label": "Variable"}, {"key": "description", "label": "Meaning"}]}], "options": [{"names": ["-D directory", "--pgdata= directory"], "summary": "Specifies the directory where the database cluster is stored.", "signature": "-D directory --pgdata= directory", "source_url": "/docs/13/app-pgchecksums.html", "description": "Specifies the directory where the database cluster is stored."}, {"names": ["-c", "--check"], "summary": "Checks checksums. This is the default mode if nothing else is specified.", "signature": "-c --check", "source_url": "/docs/13/app-pgchecksums.html", "description": "Checks checksums. This is the default mode if nothing else is specified."}, {"names": ["-d", "--disable"], "summary": "Disables checksums.", "signature": "-d --disable", "source_url": "/docs/13/app-pgchecksums.html", "description": "Disables checksums."}, {"names": ["-e", "--enable"], "summary": "Enables checksums.", "signature": "-e --enable", "source_url": "/docs/13/app-pgchecksums.html", "description": "Enables checksums."}, {"names": ["-f filenode", "--filenode= filenode"], "summary": "Only validate checksums in the relation with filenode filenode .", "signature": "-f filenode --filenode= filenode", "source_url": "/docs/13/app-pgchecksums.html", "description": "Only validate checksums in the relation with filenode filenode ."}, {"names": ["-N", "--no-sync"], "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": "-N --no-sync", "source_url": "/docs/13/app-pgchecksums.html", "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": ["-P", "--progress"], "summary": "Enable progress reporting. Turning this on will deliver a progress report while checking or enabling checksums.", "signature": "-P --progress", "source_url": "/docs/13/app-pgchecksums.html", "description": "Enable progress reporting. Turning this on will deliver a progress report while checking or enabling checksums."}, {"names": ["-v", "--verbose"], "summary": "Enable verbose output. Lists all checked files.", "signature": "-v --verbose", "source_url": "/docs/13/app-pgchecksums.html", "description": "Enable verbose output. Lists all checked files."}, {"names": ["-V", "--version"], "summary": "Print the pg_checksums version and exit.", "signature": "-V --version", "source_url": "/docs/13/app-pgchecksums.html", "description": "Print the pg_checksums version and exit."}, {"names": ["-?", "--help"], "summary": "Show help about pg_checksums command line arguments, and exit.", "signature": "-? --help", "source_url": "/docs/13/app-pgchecksums.html", "description": "Show help about pg_checksums command line arguments, and exit."}], "related": [], "release": {"ref": "https://ftp.postgresql.org/pub/source/v13.23/postgresql-13.23.tar.bz2", "label": "13.23", "major": "13", "channel": "historical", "manifest": {"pdf": {"A4": {"url": "/files/documentation/pdf/13/postgresql-13-A4.pdf", "bytes": 13843239, "pages": 2826, "sha256": "171cc09f90936dbc1cbd503a98ff07ae72ea58ab9771ff051313f1217737799c", "built_at": "2026-09-26"}, "US": {"url": "/files/documentation/pdf/13/postgresql-13-US.pdf", "bytes": 13739572, "pages": 2984, "sha256": "48d09c6e197d9db4220f41afe83efe848a8661b1b168d3b89419751ecaf6c24d", "built_at": "2026-09-26"}}, "tree": "13", "index": "index.html", "major": "13", "pages": 1139, "release": "13.23", "source_url": "https://ftp.postgresql.org/pub/source/v13.23/postgresql-13.23.tar.bz2", "svg_assets": 3, "source_mode": "en HTML verified against the pinned official archive", "source_sha256": "6ec3c82726af92b7dec873fa1cdf881eca92a4219787dfad05acb6b10e041fd6"}, "revision": "614ee3133270254e476c118cdf6f72af78d4e4b8bbd9b28ed9ab1e14e4e9c0f6", "evidence_kind": "English manual and source declarations", "source_sha256": "6ec3c82726af92b7dec873fa1cdf881eca92a4219787dfad05acb6b10e041fd6"}, "sources": [{"url": "/docs/13/app-pgchecksums.html", "file": "app-pgchecksums.html", "label": "13.23 English manual \u00b7 app-pgchecksums.html", "anchor": "", "sha256": "bbcd9ada6cdeebe1cf403334d113915cee5081cc4583e4dff5c39a16cfaa427d"}, {"url": "/docs/13/reference-server.html", "file": "reference-server.html", "label": "Server applications inventory", "anchor": "", "sha256": "074ef8577fd368272a2360309e1226e2d0b1e570a3e1da62dfcca63ac9ee5539"}], "sections": [], "synopsis": ["pg_checksums [ option ...] [[ -D | --pgdata ] datadir ]"], "signature": "pg_checksums [ option ...] [[ -D | --pgdata ] datadir ]", "description": ["pg_checksums \u2014 enable, disable or check data checksums in a PostgreSQL database cluster"], "environment": [{"name": "PGDATA", "description": "Specifies the directory where the database cluster is stored; can be overridden using the -D option."}, {"name": "PG_COLOR", "description": "Specifies whether to use color in diagnostic messages. Possible values are always , auto and never ."}], "manual_html": "<div><div class=\"refentry\" id=\"APP-PGCHECKSUMS\">\n<div class=\"titlepage\"></div>\n<div class=\"refnamediv\">\n<h2><span class=\"refentrytitle\"><span class=\"application\">pg_checksums</span></span></h2>\n<p>pg_checksums \u2014 enable, disable or check data checksums in a <span class=\"productname\">PostgreSQL</span> database cluster</p>\n</div>\n<div class=\"refsynopsisdiv\">\n<h2>Synopsis</h2>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.5.4.1\"><code class=\"command\">pg_checksums</code> [<em class=\"replaceable\"><code>option</code></em>...] [[ <code class=\"option\">-D</code> | <code class=\"option\">--pgdata</code> ]<em class=\"replaceable\"><code>datadir</code></em>]</p>\n</div>\n</div>\n<div class=\"refsect1\" id=\"R1-APP-PG_CHECKSUMS-1\">\n<h2>Description</h2>\n<p><span class=\"application\">pg_checksums</span> checks, enables or disables data checksums in a <span class=\"productname\">PostgreSQL</span> cluster. The server must be shut down cleanly before running <span class=\"application\">pg_checksums</span>. 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.</p>\n<p>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 <code class=\"filename\">pg_control</code>.</p>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.5.6\">\n<h2>Options</h2>\n<p>The following command-line options are available:</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-D <em class=\"replaceable\"><code>directory</code></em></code><br></span><span class=\"term\"><code class=\"option\">--pgdata=<em class=\"replaceable\"><code>directory</code></em></code></span></dt>\n<dd>\n<p>Specifies the directory where the database cluster is stored.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-c</code><br></span><span class=\"term\"><code class=\"option\">--check</code></span></dt>\n<dd>\n<p>Checks checksums. This is the default mode if nothing else is specified.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-d</code><br></span><span class=\"term\"><code class=\"option\">--disable</code></span></dt>\n<dd>\n<p>Disables checksums.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-e</code><br></span><span class=\"term\"><code class=\"option\">--enable</code></span></dt>\n<dd>\n<p>Enables checksums.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-f <em class=\"replaceable\"><code>filenode</code></em></code><br></span><span class=\"term\"><code class=\"option\">--filenode=<em class=\"replaceable\"><code>filenode</code></em></code></span></dt>\n<dd>\n<p>Only validate checksums in the relation with filenode <em class=\"replaceable\"><code>filenode</code></em>.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-N</code><br></span><span class=\"term\"><code class=\"option\">--no-sync</code></span></dt>\n<dd>\n<p>By default, <code class=\"command\">pg_checksums</code> will wait for all files to be written safely to disk. This option causes <code class=\"command\">pg_checksums</code> 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 <code class=\"literal\">--check</code>.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-P</code><br></span><span class=\"term\"><code class=\"option\">--progress</code></span></dt>\n<dd>\n<p>Enable progress reporting. Turning this on will deliver a progress report while checking or enabling checksums.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-v</code><br></span><span class=\"term\"><code class=\"option\">--verbose</code></span></dt>\n<dd>\n<p>Enable verbose output. Lists all checked files.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-V</code><br></span><span class=\"term\"><code class=\"option\">--version</code></span></dt>\n<dd>\n<p>Print the <span class=\"application\">pg_checksums</span> version and exit.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-?</code><br></span><span class=\"term\"><code class=\"option\">--help</code></span></dt>\n<dd>\n<p>Show help about <span class=\"application\">pg_checksums</span> command line arguments, and exit.</p>\n</dd>\n</dl>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.5.7\">\n<h2>Environment</h2>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"envar\">PGDATA</code></span></dt>\n<dd>\n<p>Specifies the directory where the database cluster is stored; can be overridden using the <code class=\"option\">-D</code> option.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"envar\">PG_COLOR</code></span></dt>\n<dd>\n<p>Specifies whether to use color in diagnostic messages. Possible values are <code class=\"literal\">always</code>, <code class=\"literal\">auto</code> and <code class=\"literal\">never</code>.</p>\n</dd>\n</dl>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.5.8\">\n<h2>Notes</h2>\n<p>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.</p>\n<p>When using a replication setup with tools which perform direct copies of relation file blocks (for example <a class=\"xref\" href=\"/docs/13/app-pgrewind.html\" title=\"pg_rewind\"><span class=\"refentrytitle\"><span class=\"application\">pg_rewind</span></span></a>), 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.</p>\n<p>If <span class=\"application\">pg_checksums</span> is aborted or killed while enabling or disabling checksums, the cluster's data checksum configuration remains unchanged, and <span class=\"application\">pg_checksums</span> can be re-run to perform the same operation.</p>\n</div>\n</div></div>", "manual_path": "app-pgchecksums.html", "comparison_data": {"options": [{"names": ["-D directory", "--pgdata= directory"], "signature": "-D directory --pgdata= directory", "description": "Specifies the directory where the database cluster is stored."}, {"names": ["-c", "--check"], "signature": "-c --check", "description": "Checks checksums. This is the default mode if nothing else is specified."}, {"names": ["-d", "--disable"], "signature": "-d --disable", "description": "Disables checksums."}, {"names": ["-e", "--enable"], "signature": "-e --enable", "description": "Enables checksums."}, {"names": ["-f filenode", "--filenode= filenode"], "signature": "-f filenode --filenode= filenode", "description": "Only validate checksums in the relation with filenode filenode ."}, {"names": ["-N", "--no-sync"], "signature": "-N --no-sync", "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": ["-P", "--progress"], "signature": "-P --progress", "description": "Enable progress reporting. Turning this on will deliver a progress report while checking or enabling checksums."}, {"names": ["-v", "--verbose"], "signature": "-v --verbose", "description": "Enable verbose output. Lists all checked files."}, {"names": ["-V", "--version"], "signature": "-V --version", "description": "Print the pg_checksums version and exit."}, {"names": ["-?", "--help"], "signature": "-? --help", "description": "Show help about pg_checksums command line arguments, and exit."}], "synopsis": ["pg_checksums [ option ...] [[ -D | --pgdata ] datadir ]"], "environment": [{"name": "PGDATA", "description": "Specifies the directory where the database cluster is stored; can be overridden using the -D option."}, {"name": "PG_COLOR", "description": "Specifies whether to use color in diagnostic messages. Possible values are always , auto and never ."}]}, "comparison_hash": "dc177d5e3b70222dba48a916063353fd7bd6e09a1784594b268608ed54ea9e7a"}, "14": {"facts": [{"label": "Documented executable", "value": "pg_checksums"}, {"label": "Executable version", "value": "14.24"}, {"label": "Reference inventory", "value": "Server applications"}, {"label": "Option definition groups", "value": "10"}], "tables": [{"key": "options", "rows": [{"summary": "Specifies the directory where the database cluster is stored.", "signature": {"url": "/docs/14/app-pgchecksums.html", "text": "-D directory --pgdata= directory"}}, {"summary": "Checks checksums. This is the default mode if nothing else is specified.", "signature": {"url": "/docs/14/app-pgchecksums.html", "text": "-c --check"}}, {"summary": "Disables checksums.", "signature": {"url": "/docs/14/app-pgchecksums.html", "text": "-d --disable"}}, {"summary": "Enables checksums.", "signature": {"url": "/docs/14/app-pgchecksums.html", "text": "-e --enable"}}, {"summary": "Only validate checksums in the relation with filenode filenode .", "signature": {"url": "/docs/14/app-pgchecksums.html", "text": "-f filenode --filenode= filenode"}}, {"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": {"url": "/docs/14/app-pgchecksums.html", "text": "-N --no-sync"}}, {"summary": "Enable progress reporting. Turning this on will deliver a progress report while checking or enabling checksums.", "signature": {"url": "/docs/14/app-pgchecksums.html", "text": "-P --progress"}}, {"summary": "Enable verbose output. Lists all checked files.", "signature": {"url": "/docs/14/app-pgchecksums.html", "text": "-v --verbose"}}, {"summary": "Print the pg_checksums version and exit.", "signature": {"url": "/docs/14/app-pgchecksums.html", "text": "-V --version"}}, {"summary": "Show help about pg_checksums command line arguments, and exit.", "signature": {"url": "/docs/14/app-pgchecksums.html", "text": "-? --help"}}], "title": "Documented options", "columns": [{"key": "signature", "label": "Option and arguments"}, {"key": "summary", "label": "Description"}]}, {"key": "environment", "rows": [{"name": "PGDATA", "description": "Specifies the directory where the database cluster is stored; can be overridden using the -D option."}, {"name": "PG_COLOR", "description": "Specifies whether to use color in diagnostic messages. Possible values are always , auto and never ."}], "title": "Environment variables", "columns": [{"key": "name", "label": "Variable"}, {"key": "description", "label": "Meaning"}]}], "options": [{"names": ["-D directory", "--pgdata= directory"], "summary": "Specifies the directory where the database cluster is stored.", "signature": "-D directory --pgdata= directory", "source_url": "/docs/14/app-pgchecksums.html", "description": "Specifies the directory where the database cluster is stored."}, {"names": ["-c", "--check"], "summary": "Checks checksums. This is the default mode if nothing else is specified.", "signature": "-c --check", "source_url": "/docs/14/app-pgchecksums.html", "description": "Checks checksums. This is the default mode if nothing else is specified."}, {"names": ["-d", "--disable"], "summary": "Disables checksums.", "signature": "-d --disable", "source_url": "/docs/14/app-pgchecksums.html", "description": "Disables checksums."}, {"names": ["-e", "--enable"], "summary": "Enables checksums.", "signature": "-e --enable", "source_url": "/docs/14/app-pgchecksums.html", "description": "Enables checksums."}, {"names": ["-f filenode", "--filenode= filenode"], "summary": "Only validate checksums in the relation with filenode filenode .", "signature": "-f filenode --filenode= filenode", "source_url": "/docs/14/app-pgchecksums.html", "description": "Only validate checksums in the relation with filenode filenode ."}, {"names": ["-N", "--no-sync"], "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": "-N --no-sync", "source_url": "/docs/14/app-pgchecksums.html", "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": ["-P", "--progress"], "summary": "Enable progress reporting. Turning this on will deliver a progress report while checking or enabling checksums.", "signature": "-P --progress", "source_url": "/docs/14/app-pgchecksums.html", "description": "Enable progress reporting. Turning this on will deliver a progress report while checking or enabling checksums."}, {"names": ["-v", "--verbose"], "summary": "Enable verbose output. Lists all checked files.", "signature": "-v --verbose", "source_url": "/docs/14/app-pgchecksums.html", "description": "Enable verbose output. Lists all checked files."}, {"names": ["-V", "--version"], "summary": "Print the pg_checksums version and exit.", "signature": "-V --version", "source_url": "/docs/14/app-pgchecksums.html", "description": "Print the pg_checksums version and exit."}, {"names": ["-?", "--help"], "summary": "Show help about pg_checksums command line arguments, and exit.", "signature": "-? --help", "source_url": "/docs/14/app-pgchecksums.html", "description": "Show help about pg_checksums command line arguments, and exit."}], "related": [], "release": {"ref": "https://ftp.postgresql.org/pub/source/v14.24/postgresql-14.24.tar.bz2", "label": "14.24", "major": "14", "channel": "stable", "manifest": {"pdf": {"A4": {"url": "/files/documentation/pdf/14/postgresql-14-A4.pdf", "bytes": 14354704, "pages": 2944, "sha256": "8bc6b9dd7b246888bb77f0a5e8c39a2eae52e9926569832669c7d1600becb27c", "built_at": "2026-09-26"}, "US": {"url": "/files/documentation/pdf/14/postgresql-14-US.pdf", "bytes": 14242178, "pages": 3102, "sha256": "b7ecb5a5f62d8b9f73a69e25a7d26ba285373bc53168a553bff7b77955506db4", "built_at": "2026-09-26"}}, "tree": "14", "index": "index.html", "major": "14", "pages": 1158, "release": "14.24", "source_url": "https://ftp.postgresql.org/pub/source/v14.24/postgresql-14.24.tar.bz2", "svg_assets": 3, "source_mode": "en HTML verified against the pinned official archive", "source_sha256": "a7fa7ed3d558172355f51406097a7bd4f6b473be80f311ef7cda96bf383d8897"}, "revision": "588700d46356d8837c77c7c0a4e71e645fe6535983b8f1830aa8f2e4e41c40ae", "evidence_kind": "English manual and source declarations", "source_sha256": "a7fa7ed3d558172355f51406097a7bd4f6b473be80f311ef7cda96bf383d8897"}, "sources": [{"url": "/docs/14/app-pgchecksums.html", "file": "app-pgchecksums.html", "label": "14.24 English manual \u00b7 app-pgchecksums.html", "anchor": "", "sha256": "54c52f23b0e8a506574a9ee17afd63fa50ca361f0ddd064f188b7870953bb812"}, {"url": "/docs/14/reference-server.html", "file": "reference-server.html", "label": "Server applications inventory", "anchor": "", "sha256": "db0cdccaa8d3c65ad3b2a07d4956eb5a783a18505bfa0f9d9626eef4ab94fe44"}], "sections": [], "synopsis": ["pg_checksums [ option ...] [[ -D | --pgdata ] datadir ]"], "signature": "pg_checksums [ option ...] [[ -D | --pgdata ] datadir ]", "description": ["pg_checksums \u2014 enable, disable or check data checksums in a PostgreSQL database cluster"], "environment": [{"name": "PGDATA", "description": "Specifies the directory where the database cluster is stored; can be overridden using the -D option."}, {"name": "PG_COLOR", "description": "Specifies whether to use color in diagnostic messages. Possible values are always , auto and never ."}], "manual_html": "<div><div class=\"refentry\" id=\"APP-PGCHECKSUMS\">\n<div class=\"titlepage\"></div>\n<div class=\"refnamediv\">\n<h2><span class=\"refentrytitle\"><span class=\"application\">pg_checksums</span></span></h2>\n<p>pg_checksums \u2014 enable, disable or check data checksums in a <span class=\"productname\">PostgreSQL</span> database cluster</p>\n</div>\n<div class=\"refsynopsisdiv\">\n<h2>Synopsis</h2>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.5.4.1\"><code class=\"command\">pg_checksums</code> [<em class=\"replaceable\"><code>option</code></em>...] [[ <code class=\"option\">-D</code> | <code class=\"option\">--pgdata</code> ]<em class=\"replaceable\"><code>datadir</code></em>]</p>\n</div>\n</div>\n<div class=\"refsect1\" id=\"R1-APP-PG_CHECKSUMS-1\">\n<h2>Description</h2>\n<p><span class=\"application\">pg_checksums</span> checks, enables or disables data checksums in a <span class=\"productname\">PostgreSQL</span> cluster. The server must be shut down cleanly before running <span class=\"application\">pg_checksums</span>. 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.</p>\n<p>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 <code class=\"filename\">pg_control</code>.</p>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.5.6\">\n<h2>Options</h2>\n<p>The following command-line options are available:</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-D <em class=\"replaceable\"><code>directory</code></em></code><br></span><span class=\"term\"><code class=\"option\">--pgdata=<em class=\"replaceable\"><code>directory</code></em></code></span></dt>\n<dd>\n<p>Specifies the directory where the database cluster is stored.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-c</code><br></span><span class=\"term\"><code class=\"option\">--check</code></span></dt>\n<dd>\n<p>Checks checksums. This is the default mode if nothing else is specified.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-d</code><br></span><span class=\"term\"><code class=\"option\">--disable</code></span></dt>\n<dd>\n<p>Disables checksums.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-e</code><br></span><span class=\"term\"><code class=\"option\">--enable</code></span></dt>\n<dd>\n<p>Enables checksums.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-f <em class=\"replaceable\"><code>filenode</code></em></code><br></span><span class=\"term\"><code class=\"option\">--filenode=<em class=\"replaceable\"><code>filenode</code></em></code></span></dt>\n<dd>\n<p>Only validate checksums in the relation with filenode <em class=\"replaceable\"><code>filenode</code></em>.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-N</code><br></span><span class=\"term\"><code class=\"option\">--no-sync</code></span></dt>\n<dd>\n<p>By default, <code class=\"command\">pg_checksums</code> will wait for all files to be written safely to disk. This option causes <code class=\"command\">pg_checksums</code> 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 <code class=\"literal\">--check</code>.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-P</code><br></span><span class=\"term\"><code class=\"option\">--progress</code></span></dt>\n<dd>\n<p>Enable progress reporting. Turning this on will deliver a progress report while checking or enabling checksums.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-v</code><br></span><span class=\"term\"><code class=\"option\">--verbose</code></span></dt>\n<dd>\n<p>Enable verbose output. Lists all checked files.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-V</code><br></span><span class=\"term\"><code class=\"option\">--version</code></span></dt>\n<dd>\n<p>Print the <span class=\"application\">pg_checksums</span> version and exit.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-?</code><br></span><span class=\"term\"><code class=\"option\">--help</code></span></dt>\n<dd>\n<p>Show help about <span class=\"application\">pg_checksums</span> command line arguments, and exit.</p>\n</dd>\n</dl>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.5.7\">\n<h2>Environment</h2>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"envar\">PGDATA</code></span></dt>\n<dd>\n<p>Specifies the directory where the database cluster is stored; can be overridden using the <code class=\"option\">-D</code> option.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"envar\">PG_COLOR</code></span></dt>\n<dd>\n<p>Specifies whether to use color in diagnostic messages. Possible values are <code class=\"literal\">always</code>, <code class=\"literal\">auto</code> and <code class=\"literal\">never</code>.</p>\n</dd>\n</dl>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.5.8\">\n<h2>Notes</h2>\n<p>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.</p>\n<p>When using a replication setup with tools which perform direct copies of relation file blocks (for example <a class=\"xref\" href=\"/docs/14/app-pgrewind.html\" title=\"pg_rewind\"><span class=\"refentrytitle\"><span class=\"application\">pg_rewind</span></span></a>), 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.</p>\n<p>If <span class=\"application\">pg_checksums</span> is aborted or killed while enabling or disabling checksums, the cluster's data checksum configuration remains unchanged, and <span class=\"application\">pg_checksums</span> can be re-run to perform the same operation.</p>\n</div>\n</div></div>", "manual_path": "app-pgchecksums.html", "comparison_data": {"options": [{"names": ["-D directory", "--pgdata= directory"], "signature": "-D directory --pgdata= directory", "description": "Specifies the directory where the database cluster is stored."}, {"names": ["-c", "--check"], "signature": "-c --check", "description": "Checks checksums. This is the default mode if nothing else is specified."}, {"names": ["-d", "--disable"], "signature": "-d --disable", "description": "Disables checksums."}, {"names": ["-e", "--enable"], "signature": "-e --enable", "description": "Enables checksums."}, {"names": ["-f filenode", "--filenode= filenode"], "signature": "-f filenode --filenode= filenode", "description": "Only validate checksums in the relation with filenode filenode ."}, {"names": ["-N", "--no-sync"], "signature": "-N --no-sync", "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": ["-P", "--progress"], "signature": "-P --progress", "description": "Enable progress reporting. Turning this on will deliver a progress report while checking or enabling checksums."}, {"names": ["-v", "--verbose"], "signature": "-v --verbose", "description": "Enable verbose output. Lists all checked files."}, {"names": ["-V", "--version"], "signature": "-V --version", "description": "Print the pg_checksums version and exit."}, {"names": ["-?", "--help"], "signature": "-? --help", "description": "Show help about pg_checksums command line arguments, and exit."}], "synopsis": ["pg_checksums [ option ...] [[ -D | --pgdata ] datadir ]"], "environment": [{"name": "PGDATA", "description": "Specifies the directory where the database cluster is stored; can be overridden using the -D option."}, {"name": "PG_COLOR", "description": "Specifies whether to use color in diagnostic messages. Possible values are always , auto and never ."}]}, "comparison_hash": "dc177d5e3b70222dba48a916063353fd7bd6e09a1784594b268608ed54ea9e7a"}, "15": {"facts": [{"label": "Documented executable", "value": "pg_checksums"}, {"label": "Executable version", "value": "15.19"}, {"label": "Reference inventory", "value": "Server applications"}, {"label": "Option definition groups", "value": "10"}], "tables": [{"key": "options", "rows": [{"summary": "Specifies the directory where the database cluster is stored.", "signature": {"url": "/docs/15/app-pgchecksums.html", "text": "-D directory --pgdata= directory"}}, {"summary": "Checks checksums. This is the default mode if nothing else is specified.", "signature": {"url": "/docs/15/app-pgchecksums.html", "text": "-c --check"}}, {"summary": "Disables checksums.", "signature": {"url": "/docs/15/app-pgchecksums.html", "text": "-d --disable"}}, {"summary": "Enables checksums.", "signature": {"url": "/docs/15/app-pgchecksums.html", "text": "-e --enable"}}, {"summary": "Only validate checksums in the relation with filenode filenode .", "signature": {"url": "/docs/15/app-pgchecksums.html", "text": "-f filenode --filenode= filenode"}}, {"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": {"url": "/docs/15/app-pgchecksums.html", "text": "-N --no-sync"}}, {"summary": "Enable progress reporting. Turning this on will deliver a progress report while checking or enabling checksums.", "signature": {"url": "/docs/15/app-pgchecksums.html", "text": "-P --progress"}}, {"summary": "Enable verbose output. Lists all checked files.", "signature": {"url": "/docs/15/app-pgchecksums.html", "text": "-v --verbose"}}, {"summary": "Print the pg_checksums version and exit.", "signature": {"url": "/docs/15/app-pgchecksums.html", "text": "-V --version"}}, {"summary": "Show help about pg_checksums command line arguments, and exit.", "signature": {"url": "/docs/15/app-pgchecksums.html", "text": "-? --help"}}], "title": "Documented options", "columns": [{"key": "signature", "label": "Option and arguments"}, {"key": "summary", "label": "Description"}]}, {"key": "environment", "rows": [{"name": "PGDATA", "description": "Specifies the directory where the database cluster is stored; can be overridden using the -D option."}, {"name": "PG_COLOR", "description": "Specifies whether to use color in diagnostic messages. Possible values are always , auto and never ."}], "title": "Environment variables", "columns": [{"key": "name", "label": "Variable"}, {"key": "description", "label": "Meaning"}]}], "options": [{"names": ["-D directory", "--pgdata= directory"], "summary": "Specifies the directory where the database cluster is stored.", "signature": "-D directory --pgdata= directory", "source_url": "/docs/15/app-pgchecksums.html", "description": "Specifies the directory where the database cluster is stored."}, {"names": ["-c", "--check"], "summary": "Checks checksums. This is the default mode if nothing else is specified.", "signature": "-c --check", "source_url": "/docs/15/app-pgchecksums.html", "description": "Checks checksums. This is the default mode if nothing else is specified."}, {"names": ["-d", "--disable"], "summary": "Disables checksums.", "signature": "-d --disable", "source_url": "/docs/15/app-pgchecksums.html", "description": "Disables checksums."}, {"names": ["-e", "--enable"], "summary": "Enables checksums.", "signature": "-e --enable", "source_url": "/docs/15/app-pgchecksums.html", "description": "Enables checksums."}, {"names": ["-f filenode", "--filenode= filenode"], "summary": "Only validate checksums in the relation with filenode filenode .", "signature": "-f filenode --filenode= filenode", "source_url": "/docs/15/app-pgchecksums.html", "description": "Only validate checksums in the relation with filenode filenode ."}, {"names": ["-N", "--no-sync"], "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": "-N --no-sync", "source_url": "/docs/15/app-pgchecksums.html", "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": ["-P", "--progress"], "summary": "Enable progress reporting. Turning this on will deliver a progress report while checking or enabling checksums.", "signature": "-P --progress", "source_url": "/docs/15/app-pgchecksums.html", "description": "Enable progress reporting. Turning this on will deliver a progress report while checking or enabling checksums."}, {"names": ["-v", "--verbose"], "summary": "Enable verbose output. Lists all checked files.", "signature": "-v --verbose", "source_url": "/docs/15/app-pgchecksums.html", "description": "Enable verbose output. Lists all checked files."}, {"names": ["-V", "--version"], "summary": "Print the pg_checksums version and exit.", "signature": "-V --version", "source_url": "/docs/15/app-pgchecksums.html", "description": "Print the pg_checksums version and exit."}, {"names": ["-?", "--help"], "summary": "Show help about pg_checksums command line arguments, and exit.", "signature": "-? --help", "source_url": "/docs/15/app-pgchecksums.html", "description": "Show help about pg_checksums command line arguments, and exit."}], "related": [], "release": {"ref": "https://ftp.postgresql.org/pub/source/v15.19/postgresql-15.19.tar.bz2", "label": "15.19", "major": "15", "channel": "stable", "manifest": {"pdf": {"A4": {"url": "/files/documentation/pdf/15/postgresql-15-A4.pdf", "bytes": 14609140, "pages": 2987, "sha256": "66228564a4d16efb47d6a914085716ecfe22ca1566db56bc7c3d82f790646d72", "built_at": "2026-09-26"}, "US": {"url": "/files/documentation/pdf/15/postgresql-15-US.pdf", "bytes": 14495690, "pages": 3153, "sha256": "645a498c2390d47a6223ec74770631185807a19c484edb0fc5a295d9f460bc02", "built_at": "2026-09-26"}}, "tree": "15", "index": "index.html", "major": "15", "pages": 1168, "release": "15.19", "source_url": "https://ftp.postgresql.org/pub/source/v15.19/postgresql-15.19.tar.bz2", "svg_assets": 3, "source_mode": "en HTML verified against the pinned official archive", "source_sha256": "e1a64a87a46b825b88c082e4518161a47aab53c45694964f8ba1df28f7859f89"}, "revision": "6af958c6520151fc7697d56e0616b03fb00522c4568158674d452ae0644ba545", "evidence_kind": "English manual and source declarations", "source_sha256": "e1a64a87a46b825b88c082e4518161a47aab53c45694964f8ba1df28f7859f89"}, "sources": [{"url": "/docs/15/app-pgchecksums.html", "file": "app-pgchecksums.html", "label": "15.19 English manual \u00b7 app-pgchecksums.html", "anchor": "", "sha256": "2c83df8804201a1d1b6fc7dab1ca63871686b1a01ce0d735c580bbceff800b66"}, {"url": "/docs/15/reference-server.html", "file": "reference-server.html", "label": "Server applications inventory", "anchor": "", "sha256": "1240cfbb13ebfd22aac8d5ae40c62a9015b246f7774bcf0bce97355ce06350a0"}], "sections": [], "synopsis": ["pg_checksums [ option ...] [[ -D | --pgdata ] datadir ]"], "signature": "pg_checksums [ option ...] [[ -D | --pgdata ] datadir ]", "description": ["pg_checksums \u2014 enable, disable or check data checksums in a PostgreSQL database cluster"], "environment": [{"name": "PGDATA", "description": "Specifies the directory where the database cluster is stored; can be overridden using the -D option."}, {"name": "PG_COLOR", "description": "Specifies whether to use color in diagnostic messages. Possible values are always , auto and never ."}], "manual_html": "<div><div class=\"refentry\" id=\"APP-PGCHECKSUMS\">\n<div class=\"titlepage\"></div>\n<div class=\"refnamediv\">\n<h2><span class=\"refentrytitle\"><span class=\"application\">pg_checksums</span></span></h2>\n<p>pg_checksums \u2014 enable, disable or check data checksums in a <span class=\"productname\">PostgreSQL</span> database cluster</p>\n</div>\n<div class=\"refsynopsisdiv\">\n<h2>Synopsis</h2>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.5.4.1\"><code class=\"command\">pg_checksums</code> [<em class=\"replaceable\"><code>option</code></em>...] [[ <code class=\"option\">-D</code> | <code class=\"option\">--pgdata</code> ]<em class=\"replaceable\"><code>datadir</code></em>]</p>\n</div>\n</div>\n<div class=\"refsect1\" id=\"R1-APP-PG_CHECKSUMS-1\">\n<h2>Description</h2>\n<p><span class=\"application\">pg_checksums</span> checks, enables or disables data checksums in a <span class=\"productname\">PostgreSQL</span> cluster. The server must be shut down cleanly before running <span class=\"application\">pg_checksums</span>. 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.</p>\n<p>When 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 <code class=\"filename\">pg_control</code>.</p>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.5.6\">\n<h2>Options</h2>\n<p>The following command-line options are available:</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-D <em class=\"replaceable\"><code>directory</code></em></code><br></span><span class=\"term\"><code class=\"option\">--pgdata=<em class=\"replaceable\"><code>directory</code></em></code></span></dt>\n<dd>\n<p>Specifies the directory where the database cluster is stored.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-c</code><br></span><span class=\"term\"><code class=\"option\">--check</code></span></dt>\n<dd>\n<p>Checks checksums. This is the default mode if nothing else is specified.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-d</code><br></span><span class=\"term\"><code class=\"option\">--disable</code></span></dt>\n<dd>\n<p>Disables checksums.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-e</code><br></span><span class=\"term\"><code class=\"option\">--enable</code></span></dt>\n<dd>\n<p>Enables checksums.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-f <em class=\"replaceable\"><code>filenode</code></em></code><br></span><span class=\"term\"><code class=\"option\">--filenode=<em class=\"replaceable\"><code>filenode</code></em></code></span></dt>\n<dd>\n<p>Only validate checksums in the relation with filenode <em class=\"replaceable\"><code>filenode</code></em>.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-N</code><br></span><span class=\"term\"><code class=\"option\">--no-sync</code></span></dt>\n<dd>\n<p>By default, <code class=\"command\">pg_checksums</code> will wait for all files to be written safely to disk. This option causes <code class=\"command\">pg_checksums</code> 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 <code class=\"literal\">--check</code>.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-P</code><br></span><span class=\"term\"><code class=\"option\">--progress</code></span></dt>\n<dd>\n<p>Enable progress reporting. Turning this on will deliver a progress report while checking or enabling checksums.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-v</code><br></span><span class=\"term\"><code class=\"option\">--verbose</code></span></dt>\n<dd>\n<p>Enable verbose output. Lists all checked files.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-V</code><br></span><span class=\"term\"><code class=\"option\">--version</code></span></dt>\n<dd>\n<p>Print the <span class=\"application\">pg_checksums</span> version and exit.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-?</code><br></span><span class=\"term\"><code class=\"option\">--help</code></span></dt>\n<dd>\n<p>Show help about <span class=\"application\">pg_checksums</span> command line arguments, and exit.</p>\n</dd>\n</dl>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.5.7\">\n<h2>Environment</h2>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"envar\">PGDATA</code></span></dt>\n<dd>\n<p>Specifies the directory where the database cluster is stored; can be overridden using the <code class=\"option\">-D</code> option.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"envar\">PG_COLOR</code></span></dt>\n<dd>\n<p>Specifies whether to use color in diagnostic messages. Possible values are <code class=\"literal\">always</code>, <code class=\"literal\">auto</code> and <code class=\"literal\">never</code>.</p>\n</dd>\n</dl>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.5.8\">\n<h2>Notes</h2>\n<p>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.</p>\n<p>When using a replication setup with tools which perform direct copies of relation file blocks (for example <a class=\"xref\" href=\"/docs/15/app-pgrewind.html\" title=\"pg_rewind\"><span class=\"refentrytitle\"><span class=\"application\">pg_rewind</span></span></a>), 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.</p>\n<p>If <span class=\"application\">pg_checksums</span> is aborted or killed while enabling or disabling checksums, the cluster's data checksum configuration remains unchanged, and <span class=\"application\">pg_checksums</span> can be re-run to perform the same operation.</p>\n</div>\n</div></div>", "manual_path": "app-pgchecksums.html", "comparison_data": {"options": [{"names": ["-D directory", "--pgdata= directory"], "signature": "-D directory --pgdata= directory", "description": "Specifies the directory where the database cluster is stored."}, {"names": ["-c", "--check"], "signature": "-c --check", "description": "Checks checksums. This is the default mode if nothing else is specified."}, {"names": ["-d", "--disable"], "signature": "-d --disable", "description": "Disables checksums."}, {"names": ["-e", "--enable"], "signature": "-e --enable", "description": "Enables checksums."}, {"names": ["-f filenode", "--filenode= filenode"], "signature": "-f filenode --filenode= filenode", "description": "Only validate checksums in the relation with filenode filenode ."}, {"names": ["-N", "--no-sync"], "signature": "-N --no-sync", "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": ["-P", "--progress"], "signature": "-P --progress", "description": "Enable progress reporting. Turning this on will deliver a progress report while checking or enabling checksums."}, {"names": ["-v", "--verbose"], "signature": "-v --verbose", "description": "Enable verbose output. Lists all checked files."}, {"names": ["-V", "--version"], "signature": "-V --version", "description": "Print the pg_checksums version and exit."}, {"names": ["-?", "--help"], "signature": "-? --help", "description": "Show help about pg_checksums command line arguments, and exit."}], "synopsis": ["pg_checksums [ option ...] [[ -D | --pgdata ] datadir ]"], "environment": [{"name": "PGDATA", "description": "Specifies the directory where the database cluster is stored; can be overridden using the -D option."}, {"name": "PG_COLOR", "description": "Specifies whether to use color in diagnostic messages. Possible values are always , auto and never ."}]}, "comparison_hash": "dc177d5e3b70222dba48a916063353fd7bd6e09a1784594b268608ed54ea9e7a"}, "16": {"facts": [{"label": "Documented executable", "value": "pg_checksums"}, {"label": "Executable version", "value": "16.15"}, {"label": "Reference inventory", "value": "Server applications"}, {"label": "Option definition groups", "value": "10"}], "tables": [{"key": "options", "rows": [{"summary": "Specifies the directory where the database cluster is stored.", "signature": {"url": "/docs/16/app-pgchecksums.html", "text": "-D directory --pgdata= directory"}}, {"summary": "Checks checksums. This is the default mode if nothing else is specified.", "signature": {"url": "/docs/16/app-pgchecksums.html", "text": "-c --check"}}, {"summary": "Disables checksums.", "signature": {"url": "/docs/16/app-pgchecksums.html", "text": "-d --disable"}}, {"summary": "Enables checksums.", "signature": {"url": "/docs/16/app-pgchecksums.html", "text": "-e --enable"}}, {"summary": "Only validate checksums in the relation with filenode filenode .", "signature": {"url": "/docs/16/app-pgchecksums.html", "text": "-f filenode --filenode= filenode"}}, {"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": {"url": "/docs/16/app-pgchecksums.html", "text": "-N --no-sync"}}, {"summary": "Enable progress reporting. Turning this on will deliver a progress report while checking or enabling checksums.", "signature": {"url": "/docs/16/app-pgchecksums.html", "text": "-P --progress"}}, {"summary": "Enable verbose output. Lists all checked files.", "signature": {"url": "/docs/16/app-pgchecksums.html", "text": "-v --verbose"}}, {"summary": "Print the pg_checksums version and exit.", "signature": {"url": "/docs/16/app-pgchecksums.html", "text": "-V --version"}}, {"summary": "Show help about pg_checksums command line arguments, and exit.", "signature": {"url": "/docs/16/app-pgchecksums.html", "text": "-? --help"}}], "title": "Documented options", "columns": [{"key": "signature", "label": "Option and arguments"}, {"key": "summary", "label": "Description"}]}, {"key": "environment", "rows": [{"name": "PGDATA", "description": "Specifies the directory where the database cluster is stored; can be overridden using the -D option."}, {"name": "PG_COLOR", "description": "Specifies whether to use color in diagnostic messages. Possible values are always , auto and never ."}], "title": "Environment variables", "columns": [{"key": "name", "label": "Variable"}, {"key": "description", "label": "Meaning"}]}], "options": [{"names": ["-D directory", "--pgdata= directory"], "summary": "Specifies the directory where the database cluster is stored.", "signature": "-D directory --pgdata= directory", "source_url": "/docs/16/app-pgchecksums.html", "description": "Specifies the directory where the database cluster is stored."}, {"names": ["-c", "--check"], "summary": "Checks checksums. This is the default mode if nothing else is specified.", "signature": "-c --check", "source_url": "/docs/16/app-pgchecksums.html", "description": "Checks checksums. This is the default mode if nothing else is specified."}, {"names": ["-d", "--disable"], "summary": "Disables checksums.", "signature": "-d --disable", "source_url": "/docs/16/app-pgchecksums.html", "description": "Disables checksums."}, {"names": ["-e", "--enable"], "summary": "Enables checksums.", "signature": "-e --enable", "source_url": "/docs/16/app-pgchecksums.html", "description": "Enables checksums."}, {"names": ["-f filenode", "--filenode= filenode"], "summary": "Only validate checksums in the relation with filenode filenode .", "signature": "-f filenode --filenode= filenode", "source_url": "/docs/16/app-pgchecksums.html", "description": "Only validate checksums in the relation with filenode filenode ."}, {"names": ["-N", "--no-sync"], "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": "-N --no-sync", "source_url": "/docs/16/app-pgchecksums.html", "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": ["-P", "--progress"], "summary": "Enable progress reporting. Turning this on will deliver a progress report while checking or enabling checksums.", "signature": "-P --progress", "source_url": "/docs/16/app-pgchecksums.html", "description": "Enable progress reporting. Turning this on will deliver a progress report while checking or enabling checksums."}, {"names": ["-v", "--verbose"], "summary": "Enable verbose output. Lists all checked files.", "signature": "-v --verbose", "source_url": "/docs/16/app-pgchecksums.html", "description": "Enable verbose output. Lists all checked files."}, {"names": ["-V", "--version"], "summary": "Print the pg_checksums version and exit.", "signature": "-V --version", "source_url": "/docs/16/app-pgchecksums.html", "description": "Print the pg_checksums version and exit."}, {"names": ["-?", "--help"], "summary": "Show help about pg_checksums command line arguments, and exit.", "signature": "-? --help", "source_url": "/docs/16/app-pgchecksums.html", "description": "Show help about pg_checksums command line arguments, and exit."}], "related": [], "release": {"ref": "https://ftp.postgresql.org/pub/source/v16.15/postgresql-16.15.tar.bz2", "label": "16.15", "major": "16", "channel": "stable", "manifest": {"pdf": {"A4": {"url": "/files/documentation/pdf/16/postgresql-16-A4.pdf", "bytes": 15282337, "pages": 3055, "sha256": "4bb6c1f63deedac98736d8c4c7bc0fad0ac24e85b07e21ee10411872f06afd06", "built_at": "2026-09-26"}, "US": {"url": "/files/documentation/pdf/16/postgresql-16-US.pdf", "bytes": 15164148, "pages": 3220, "sha256": "5b6b6166c89991199e144bb0ae34c17a5f29826251dbf19db1abc0df3a3e771b", "built_at": "2026-09-26"}}, "tree": "16", "index": "index.html", "major": "16", "pages": 1169, "release": "16.15", "source_url": "https://ftp.postgresql.org/pub/source/v16.15/postgresql-16.15.tar.bz2", "svg_assets": 3, "source_mode": "en HTML verified against the pinned official archive", "source_sha256": "c1575341fa7bd40f5274ea465b34390f4dc64cdd0770af327005caaeb9f6b7ed"}, "revision": "3c21e58b35318021716440e67bb8bafd392b6a2b965a244d90e9e33c99e0bdef", "evidence_kind": "English manual and source declarations", "source_sha256": "c1575341fa7bd40f5274ea465b34390f4dc64cdd0770af327005caaeb9f6b7ed"}, "sources": [{"url": "/docs/16/app-pgchecksums.html", "file": "app-pgchecksums.html", "label": "16.15 English manual \u00b7 app-pgchecksums.html", "anchor": "", "sha256": "36e362f6ae0915dd10a98609d98a51e9dfe832d2f4a3ac45c1304de3627d4618"}, {"url": "/docs/16/reference-server.html", "file": "reference-server.html", "label": "Server applications inventory", "anchor": "", "sha256": "8aaa4422eece8f26d84715f855d9d0f7f87b200f8b82898c73c865ee42c2c70f"}], "sections": [], "synopsis": ["pg_checksums [ option ...] [[ -D | --pgdata ] datadir ]"], "signature": "pg_checksums [ option ...] [[ -D | --pgdata ] datadir ]", "description": ["pg_checksums \u2014 enable, disable or check data checksums in a PostgreSQL database cluster"], "environment": [{"name": "PGDATA", "description": "Specifies the directory where the database cluster is stored; can be overridden using the -D option."}, {"name": "PG_COLOR", "description": "Specifies whether to use color in diagnostic messages. Possible values are always , auto and never ."}], "manual_html": "<div><div class=\"refentry\" id=\"APP-PGCHECKSUMS\">\n<div class=\"titlepage\"></div>\n<div class=\"refnamediv\">\n<h2><span class=\"refentrytitle\"><span class=\"application\">pg_checksums</span></span></h2>\n<p>pg_checksums \u2014 enable, disable or check data checksums in a <span class=\"productname\">PostgreSQL</span> database cluster</p>\n</div>\n<div class=\"refsynopsisdiv\">\n<h2>Synopsis</h2>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.5.4.1\"><code class=\"command\">pg_checksums</code> [<em class=\"replaceable\"><code>option</code></em>...] [[ <code class=\"option\">-D</code> | <code class=\"option\">--pgdata</code> ]<em class=\"replaceable\"><code>datadir</code></em>]</p>\n</div>\n</div>\n<div class=\"refsect1\" id=\"R1-APP-PGCHECKSUMS-1\">\n<h2>Description</h2>\n<p><span class=\"application\">pg_checksums</span> checks, enables or disables data checksums in a <span class=\"productname\">PostgreSQL</span> cluster. The server must be shut down cleanly before running <span class=\"application\">pg_checksums</span>. 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.</p>\n<p>When 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 <code class=\"filename\">pg_control</code>.</p>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.5.6\">\n<h2>Options</h2>\n<p>The following command-line options are available:</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-D <em class=\"replaceable\"><code>directory</code></em></code><br></span><span class=\"term\"><code class=\"option\">--pgdata=<em class=\"replaceable\"><code>directory</code></em></code></span></dt>\n<dd>\n<p>Specifies the directory where the database cluster is stored.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-c</code><br></span><span class=\"term\"><code class=\"option\">--check</code></span></dt>\n<dd>\n<p>Checks checksums. This is the default mode if nothing else is specified.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-d</code><br></span><span class=\"term\"><code class=\"option\">--disable</code></span></dt>\n<dd>\n<p>Disables checksums.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-e</code><br></span><span class=\"term\"><code class=\"option\">--enable</code></span></dt>\n<dd>\n<p>Enables checksums.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-f <em class=\"replaceable\"><code>filenode</code></em></code><br></span><span class=\"term\"><code class=\"option\">--filenode=<em class=\"replaceable\"><code>filenode</code></em></code></span></dt>\n<dd>\n<p>Only validate checksums in the relation with filenode <em class=\"replaceable\"><code>filenode</code></em>.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-N</code><br></span><span class=\"term\"><code class=\"option\">--no-sync</code></span></dt>\n<dd>\n<p>By default, <code class=\"command\">pg_checksums</code> will wait for all files to be written safely to disk. This option causes <code class=\"command\">pg_checksums</code> 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 <code class=\"literal\">--check</code>.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-P</code><br></span><span class=\"term\"><code class=\"option\">--progress</code></span></dt>\n<dd>\n<p>Enable progress reporting. Turning this on will deliver a progress report while checking or enabling checksums.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-v</code><br></span><span class=\"term\"><code class=\"option\">--verbose</code></span></dt>\n<dd>\n<p>Enable verbose output. Lists all checked files.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-V</code><br></span><span class=\"term\"><code class=\"option\">--version</code></span></dt>\n<dd>\n<p>Print the <span class=\"application\">pg_checksums</span> version and exit.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-?</code><br></span><span class=\"term\"><code class=\"option\">--help</code></span></dt>\n<dd>\n<p>Show help about <span class=\"application\">pg_checksums</span> command line arguments, and exit.</p>\n</dd>\n</dl>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.5.7\">\n<h2>Environment</h2>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"envar\">PGDATA</code></span></dt>\n<dd>\n<p>Specifies the directory where the database cluster is stored; can be overridden using the <code class=\"option\">-D</code> option.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"envar\">PG_COLOR</code></span></dt>\n<dd>\n<p>Specifies whether to use color in diagnostic messages. Possible values are <code class=\"literal\">always</code>, <code class=\"literal\">auto</code> and <code class=\"literal\">never</code>.</p>\n</dd>\n</dl>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.5.8\">\n<h2>Notes</h2>\n<p>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.</p>\n<p>When using a replication setup with tools which perform direct copies of relation file blocks (for example <a class=\"xref\" href=\"/docs/16/app-pgrewind.html\" title=\"pg_rewind\"><span class=\"refentrytitle\"><span class=\"application\">pg_rewind</span></span></a>), 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.</p>\n<p>If <span class=\"application\">pg_checksums</span> is aborted or killed while enabling or disabling checksums, the cluster's data checksum configuration remains unchanged, and <span class=\"application\">pg_checksums</span> can be re-run to perform the same operation.</p>\n</div>\n</div></div>", "manual_path": "app-pgchecksums.html", "comparison_data": {"options": [{"names": ["-D directory", "--pgdata= directory"], "signature": "-D directory --pgdata= directory", "description": "Specifies the directory where the database cluster is stored."}, {"names": ["-c", "--check"], "signature": "-c --check", "description": "Checks checksums. This is the default mode if nothing else is specified."}, {"names": ["-d", "--disable"], "signature": "-d --disable", "description": "Disables checksums."}, {"names": ["-e", "--enable"], "signature": "-e --enable", "description": "Enables checksums."}, {"names": ["-f filenode", "--filenode= filenode"], "signature": "-f filenode --filenode= filenode", "description": "Only validate checksums in the relation with filenode filenode ."}, {"names": ["-N", "--no-sync"], "signature": "-N --no-sync", "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": ["-P", "--progress"], "signature": "-P --progress", "description": "Enable progress reporting. Turning this on will deliver a progress report while checking or enabling checksums."}, {"names": ["-v", "--verbose"], "signature": "-v --verbose", "description": "Enable verbose output. Lists all checked files."}, {"names": ["-V", "--version"], "signature": "-V --version", "description": "Print the pg_checksums version and exit."}, {"names": ["-?", "--help"], "signature": "-? --help", "description": "Show help about pg_checksums command line arguments, and exit."}], "synopsis": ["pg_checksums [ option ...] [[ -D | --pgdata ] datadir ]"], "environment": [{"name": "PGDATA", "description": "Specifies the directory where the database cluster is stored; can be overridden using the -D option."}, {"name": "PG_COLOR", "description": "Specifies whether to use color in diagnostic messages. Possible values are always , auto and never ."}]}, "comparison_hash": "dc177d5e3b70222dba48a916063353fd7bd6e09a1784594b268608ed54ea9e7a"}, "17": {"facts": [{"label": "Documented executable", "value": "pg_checksums"}, {"label": "Executable version", "value": "17.11"}, {"label": "Reference inventory", "value": "Server applications"}, {"label": "Option definition groups", "value": "11"}], "tables": [{"key": "options", "rows": [{"summary": "Specifies the directory where the database cluster is stored.", "signature": {"url": "/docs/17/app-pgchecksums.html", "text": "-D directory --pgdata= directory"}}, {"summary": "Checks checksums. This is the default mode if nothing else is specified.", "signature": {"url": "/docs/17/app-pgchecksums.html", "text": "-c --check"}}, {"summary": "Disables checksums.", "signature": {"url": "/docs/17/app-pgchecksums.html", "text": "-d --disable"}}, {"summary": "Enables checksums.", "signature": {"url": "/docs/17/app-pgchecksums.html", "text": "-e --enable"}}, {"summary": "Only validate checksums in the relation with filenode filenode .", "signature": {"url": "/docs/17/app-pgchecksums.html", "text": "-f filenode --filenode= filenode"}}, {"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": {"url": "/docs/17/app-pgchecksums.html", "text": "-N --no-sync"}}, {"summary": "Enable progress reporting. Turning this on will deliver a progress report while checking or enabling checksums.", "signature": {"url": "/docs/17/app-pgchecksums.html", "text": "-P --progress"}}, {"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": {"url": "/docs/17/app-pgchecksums.html", "text": "--sync-method= method"}}, {"summary": "Enable verbose output. Lists all checked files.", "signature": {"url": "/docs/17/app-pgchecksums.html", "text": "-v --verbose"}}, {"summary": "Print the pg_checksums version and exit.", "signature": {"url": "/docs/17/app-pgchecksums.html", "text": "-V --version"}}, {"summary": "Show help about pg_checksums command line arguments, and exit.", "signature": {"url": "/docs/17/app-pgchecksums.html", "text": "-? --help"}}], "title": "Documented options", "columns": [{"key": "signature", "label": "Option and arguments"}, {"key": "summary", "label": "Description"}]}, {"key": "environment", "rows": [{"name": "PGDATA", "description": "Specifies the directory where the database cluster is stored; can be overridden using the -D option."}, {"name": "PG_COLOR", "description": "Specifies whether to use color in diagnostic messages. Possible values are always , auto and never ."}], "title": "Environment variables", "columns": [{"key": "name", "label": "Variable"}, {"key": "description", "label": "Meaning"}]}], "options": [{"names": ["-D directory", "--pgdata= directory"], "summary": "Specifies the directory where the database cluster is stored.", "signature": "-D directory --pgdata= directory", "source_url": "/docs/17/app-pgchecksums.html", "description": "Specifies the directory where the database cluster is stored."}, {"names": ["-c", "--check"], "summary": "Checks checksums. This is the default mode if nothing else is specified.", "signature": "-c --check", "source_url": "/docs/17/app-pgchecksums.html", "description": "Checks checksums. This is the default mode if nothing else is specified."}, {"names": ["-d", "--disable"], "summary": "Disables checksums.", "signature": "-d --disable", "source_url": "/docs/17/app-pgchecksums.html", "description": "Disables checksums."}, {"names": ["-e", "--enable"], "summary": "Enables checksums.", "signature": "-e --enable", "source_url": "/docs/17/app-pgchecksums.html", "description": "Enables checksums."}, {"names": ["-f filenode", "--filenode= filenode"], "summary": "Only validate checksums in the relation with filenode filenode .", "signature": "-f filenode --filenode= filenode", "source_url": "/docs/17/app-pgchecksums.html", "description": "Only validate checksums in the relation with filenode filenode ."}, {"names": ["-N", "--no-sync"], "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": "-N --no-sync", "source_url": "/docs/17/app-pgchecksums.html", "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": ["-P", "--progress"], "summary": "Enable progress reporting. Turning this on will deliver a progress report while checking or enabling checksums.", "signature": "-P --progress", "source_url": "/docs/17/app-pgchecksums.html", "description": "Enable progress reporting. Turning this on will deliver a progress report while checking or enabling checksums."}, {"names": ["--sync-method= method"], "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": "--sync-method= method", "source_url": "/docs/17/app-pgchecksums.html", "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": ["-v", "--verbose"], "summary": "Enable verbose output. Lists all checked files.", "signature": "-v --verbose", "source_url": "/docs/17/app-pgchecksums.html", "description": "Enable verbose output. Lists all checked files."}, {"names": ["-V", "--version"], "summary": "Print the pg_checksums version and exit.", "signature": "-V --version", "source_url": "/docs/17/app-pgchecksums.html", "description": "Print the pg_checksums version and exit."}, {"names": ["-?", "--help"], "summary": "Show help about pg_checksums command line arguments, and exit.", "signature": "-? --help", "source_url": "/docs/17/app-pgchecksums.html", "description": "Show help about pg_checksums command line arguments, and exit."}], "related": [], "release": {"ref": "https://ftp.postgresql.org/pub/source/v17.11/postgresql-17.11.tar.bz2", "label": "17.11", "major": "17", "channel": "stable", "manifest": {"pdf": {"A4": {"url": "/files/documentation/pdf/17/postgresql-17-A4.pdf", "bytes": 15521293, "pages": 3099, "sha256": "1991354df0dc89e70ec39328c28988ef8b19c6a93671dab3893650b63e9f4e36", "built_at": "2026-09-26"}, "US": {"url": "/files/documentation/pdf/17/postgresql-17-US.pdf", "bytes": 15398150, "pages": 3270, "sha256": "07696c8f38abf31babf22d2db337093936e7c472d2af36d050b000c49bbcf52c", "built_at": "2026-09-26"}}, "tree": "17", "index": "index.html", "major": "17", "pages": 1143, "release": "17.11", "source_url": "https://ftp.postgresql.org/pub/source/v17.11/postgresql-17.11.tar.bz2", "svg_assets": 3, "source_mode": "en SGML built with pinned official archive", "source_sha256": "dd27f2b3c59e73ed14aa3324901242bf69a032a6347805f274e6260322d42979"}, "revision": "58419c9b0dd42cb34c8d53695bb025a7e582edf55ccd4c5bcb1c2c7c71a37487", "evidence_kind": "English manual and source declarations", "source_sha256": "dd27f2b3c59e73ed14aa3324901242bf69a032a6347805f274e6260322d42979"}, "sources": [{"url": "/docs/17/app-pgchecksums.html", "file": "app-pgchecksums.html", "label": "17.11 English manual \u00b7 app-pgchecksums.html", "anchor": "", "sha256": "088d4d799d0334e62132c19aff06daacb91becddfe984848ff5df2f73b68a31e"}, {"url": "/docs/17/reference-server.html", "file": "reference-server.html", "label": "Server applications inventory", "anchor": "", "sha256": "01f07993ff020684f4c290d17cdafa26fb17ea5c1d476bc3a5efc68bf8ddd9b9"}], "sections": [], "synopsis": ["pg_checksums [ option ...] [[ -D | --pgdata ] datadir ]"], "signature": "pg_checksums [ option ...] [[ -D | --pgdata ] datadir ]", "description": ["pg_checksums \u2014 enable, disable or check data checksums in a PostgreSQL database cluster"], "environment": [{"name": "PGDATA", "description": "Specifies the directory where the database cluster is stored; can be overridden using the -D option."}, {"name": "PG_COLOR", "description": "Specifies whether to use color in diagnostic messages. Possible values are always , auto and never ."}], "manual_html": "<div><div class=\"refentry\" id=\"APP-PGCHECKSUMS\">\n<div class=\"titlepage\"></div>\n<div class=\"refnamediv\">\n<h2><span class=\"refentrytitle\"><span class=\"application\">pg_checksums</span></span></h2>\n<p>pg_checksums \u2014 enable, disable or check data checksums in a <span class=\"productname\">PostgreSQL</span> database cluster</p>\n</div>\n<div class=\"refsynopsisdiv\">\n<h2>Synopsis</h2>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.5.4.1\"><code class=\"command\">pg_checksums</code> [<em class=\"replaceable\"><code>option</code></em>...] [[ <code class=\"option\">-D</code> | <code class=\"option\">--pgdata</code> ]<em class=\"replaceable\"><code>datadir</code></em>]</p>\n</div>\n</div>\n<div class=\"refsect1\" id=\"R1-APP-PGCHECKSUMS-1\">\n<h2>Description</h2>\n<p><span class=\"application\">pg_checksums</span> checks, enables or disables data checksums in a <span class=\"productname\">PostgreSQL</span> cluster. The server must be shut down cleanly before running <span class=\"application\">pg_checksums</span>. 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.</p>\n<p>When 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 <code class=\"filename\">pg_control</code>.</p>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.5.6\">\n<h2>Options</h2>\n<p>The following command-line options are available:</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-D <em class=\"replaceable\"><code>directory</code></em></code><br></span><span class=\"term\"><code class=\"option\">--pgdata=<em class=\"replaceable\"><code>directory</code></em></code></span></dt>\n<dd>\n<p>Specifies the directory where the database cluster is stored.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-c</code><br></span><span class=\"term\"><code class=\"option\">--check</code></span></dt>\n<dd>\n<p>Checks checksums. This is the default mode if nothing else is specified.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-d</code><br></span><span class=\"term\"><code class=\"option\">--disable</code></span></dt>\n<dd>\n<p>Disables checksums.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-e</code><br></span><span class=\"term\"><code class=\"option\">--enable</code></span></dt>\n<dd>\n<p>Enables checksums.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-f <em class=\"replaceable\"><code>filenode</code></em></code><br></span><span class=\"term\"><code class=\"option\">--filenode=<em class=\"replaceable\"><code>filenode</code></em></code></span></dt>\n<dd>\n<p>Only validate checksums in the relation with filenode <em class=\"replaceable\"><code>filenode</code></em>.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-N</code><br></span><span class=\"term\"><code class=\"option\">--no-sync</code></span></dt>\n<dd>\n<p>By default, <code class=\"command\">pg_checksums</code> will wait for all files to be written safely to disk. This option causes <code class=\"command\">pg_checksums</code> 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 <code class=\"literal\">--check</code>.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-P</code><br></span><span class=\"term\"><code class=\"option\">--progress</code></span></dt>\n<dd>\n<p>Enable progress reporting. Turning this on will deliver a progress report while checking or enabling checksums.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--sync-method=<em class=\"replaceable\"><code>method</code></em></code></span></dt>\n<dd>\n<p>When set to <code class=\"literal\">fsync</code>, which is the default, <code class=\"command\">pg_checksums</code> 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.</p>\n<p>On Linux, <code class=\"literal\">syncfs</code> 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 <a class=\"xref\" href=\"/docs/17/runtime-config-error-handling.html#GUC-RECOVERY-INIT-SYNC-METHOD\">recovery_init_sync_method</a> for information about the caveats to be aware of when using <code class=\"literal\">syncfs</code>.</p>\n<p>This option has no effect when <code class=\"option\">--no-sync</code> is used.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-v</code><br></span><span class=\"term\"><code class=\"option\">--verbose</code></span></dt>\n<dd>\n<p>Enable verbose output. Lists all checked files.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-V</code><br></span><span class=\"term\"><code class=\"option\">--version</code></span></dt>\n<dd>\n<p>Print the <span class=\"application\">pg_checksums</span> version and exit.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-?</code><br></span><span class=\"term\"><code class=\"option\">--help</code></span></dt>\n<dd>\n<p>Show help about <span class=\"application\">pg_checksums</span> command line arguments, and exit.</p>\n</dd>\n</dl>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.5.7\">\n<h2>Environment</h2>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"envar\">PGDATA</code></span></dt>\n<dd>\n<p>Specifies the directory where the database cluster is stored; can be overridden using the <code class=\"option\">-D</code> option.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"envar\">PG_COLOR</code></span></dt>\n<dd>\n<p>Specifies whether to use color in diagnostic messages. Possible values are <code class=\"literal\">always</code>, <code class=\"literal\">auto</code> and <code class=\"literal\">never</code>.</p>\n</dd>\n</dl>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.5.8\">\n<h2>Notes</h2>\n<p>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.</p>\n<p>When using a replication setup with tools which perform direct copies of relation file blocks (for example <a class=\"xref\" href=\"/docs/17/app-pgrewind.html\" title=\"pg_rewind\"><span class=\"refentrytitle\"><span class=\"application\">pg_rewind</span></span></a>), 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.</p>\n<p>If <span class=\"application\">pg_checksums</span> is aborted or killed while enabling or disabling checksums, the cluster's data checksum configuration remains unchanged, and <span class=\"application\">pg_checksums</span> can be re-run to perform the same operation.</p>\n</div>\n</div></div>", "manual_path": "app-pgchecksums.html", "comparison_data": {"options": [{"names": ["-D directory", "--pgdata= directory"], "signature": "-D directory --pgdata= directory", "description": "Specifies the directory where the database cluster is stored."}, {"names": ["-c", "--check"], "signature": "-c --check", "description": "Checks checksums. This is the default mode if nothing else is specified."}, {"names": ["-d", "--disable"], "signature": "-d --disable", "description": "Disables checksums."}, {"names": ["-e", "--enable"], "signature": "-e --enable", "description": "Enables checksums."}, {"names": ["-f filenode", "--filenode= filenode"], "signature": "-f filenode --filenode= filenode", "description": "Only validate checksums in the relation with filenode filenode ."}, {"names": ["-N", "--no-sync"], "signature": "-N --no-sync", "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": ["-P", "--progress"], "signature": "-P --progress", "description": "Enable progress reporting. Turning this on will deliver a progress report while checking or enabling checksums."}, {"names": ["--sync-method= method"], "signature": "--sync-method= method", "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": ["-v", "--verbose"], "signature": "-v --verbose", "description": "Enable verbose output. Lists all checked files."}, {"names": ["-V", "--version"], "signature": "-V --version", "description": "Print the pg_checksums version and exit."}, {"names": ["-?", "--help"], "signature": "-? --help", "description": "Show help about pg_checksums command line arguments, and exit."}], "synopsis": ["pg_checksums [ option ...] [[ -D | --pgdata ] datadir ]"], "environment": [{"name": "PGDATA", "description": "Specifies the directory where the database cluster is stored; can be overridden using the -D option."}, {"name": "PG_COLOR", "description": "Specifies whether to use color in diagnostic messages. Possible values are always , auto and never ."}]}, "comparison_hash": "9df98d0a65050d461414d0c4fc42b1f97bbb808ec68690d4aad884d9b571bb05"}, "18": {"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"}], "tables": [{"key": "options", "rows": [{"summary": "Specifies the directory where the database cluster is stored.", "signature": {"url": "/docs/18/app-pgchecksums.html", "text": "-D directory --pgdata= directory"}}, {"summary": "Checks checksums. This is the default mode if nothing else is specified.", "signature": {"url": "/docs/18/app-pgchecksums.html", "text": "-c --check"}}, {"summary": "Disables checksums.", "signature": {"url": "/docs/18/app-pgchecksums.html", "text": "-d --disable"}}, {"summary": "Enables checksums.", "signature": {"url": "/docs/18/app-pgchecksums.html", "text": "-e --enable"}}, {"summary": "Only validate checksums in the relation with filenode filenode .", "signature": {"url": "/docs/18/app-pgchecksums.html", "text": "-f filenode --filenode= filenode"}}, {"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": {"url": "/docs/18/app-pgchecksums.html", "text": "-N --no-sync"}}, {"summary": "Enable progress reporting. Turning this on will deliver a progress report while checking or enabling checksums.", "signature": {"url": "/docs/18/app-pgchecksums.html", "text": "-P --progress"}}, {"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": {"url": "/docs/18/app-pgchecksums.html", "text": "--sync-method= method"}}, {"summary": "Enable verbose output. Lists all checked files.", "signature": {"url": "/docs/18/app-pgchecksums.html", "text": "-v --verbose"}}, {"summary": "Print the pg_checksums version and exit.", "signature": {"url": "/docs/18/app-pgchecksums.html", "text": "-V --version"}}, {"summary": "Show help about pg_checksums command line arguments, and exit.", "signature": {"url": "/docs/18/app-pgchecksums.html", "text": "-? --help"}}], "title": "Documented options", "columns": [{"key": "signature", "label": "Option and arguments"}, {"key": "summary", "label": "Description"}]}, {"key": "environment", "rows": [{"name": "PGDATA", "description": "Specifies the directory where the database cluster is stored; can be overridden using the -D option."}, {"name": "PG_COLOR", "description": "Specifies whether to use color in diagnostic messages. Possible values are always , auto and never ."}], "title": "Environment variables", "columns": [{"key": "name", "label": "Variable"}, {"key": "description", "label": "Meaning"}]}], "options": [{"names": ["-D directory", "--pgdata= directory"], "summary": "Specifies the directory where the database cluster is stored.", "signature": "-D directory --pgdata= directory", "source_url": "/docs/18/app-pgchecksums.html", "description": "Specifies the directory where the database cluster is stored."}, {"names": ["-c", "--check"], "summary": "Checks checksums. This is the default mode if nothing else is specified.", "signature": "-c --check", "source_url": "/docs/18/app-pgchecksums.html", "description": "Checks checksums. This is the default mode if nothing else is specified."}, {"names": ["-d", "--disable"], "summary": "Disables checksums.", "signature": "-d --disable", "source_url": "/docs/18/app-pgchecksums.html", "description": "Disables checksums."}, {"names": ["-e", "--enable"], "summary": "Enables checksums.", "signature": "-e --enable", "source_url": "/docs/18/app-pgchecksums.html", "description": "Enables checksums."}, {"names": ["-f filenode", "--filenode= filenode"], "summary": "Only validate checksums in the relation with filenode filenode .", "signature": "-f filenode --filenode= filenode", "source_url": "/docs/18/app-pgchecksums.html", "description": "Only validate checksums in the relation with filenode filenode ."}, {"names": ["-N", "--no-sync"], "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": "-N --no-sync", "source_url": "/docs/18/app-pgchecksums.html", "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": ["-P", "--progress"], "summary": "Enable progress reporting. Turning this on will deliver a progress report while checking or enabling checksums.", "signature": "-P --progress", "source_url": "/docs/18/app-pgchecksums.html", "description": "Enable progress reporting. Turning this on will deliver a progress report while checking or enabling checksums."}, {"names": ["--sync-method= method"], "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": "--sync-method= method", "source_url": "/docs/18/app-pgchecksums.html", "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": ["-v", "--verbose"], "summary": "Enable verbose output. Lists all checked files.", "signature": "-v --verbose", "source_url": "/docs/18/app-pgchecksums.html", "description": "Enable verbose output. Lists all checked files."}, {"names": ["-V", "--version"], "summary": "Print the pg_checksums version and exit.", "signature": "-V --version", "source_url": "/docs/18/app-pgchecksums.html", "description": "Print the pg_checksums version and exit."}, {"names": ["-?", "--help"], "summary": "Show help about pg_checksums command line arguments, and exit.", "signature": "-? --help", "source_url": "/docs/18/app-pgchecksums.html", "description": "Show help about pg_checksums command line arguments, and exit."}], "related": [], "release": {"ref": "https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2", "label": "18.6", "major": "18", "channel": "stable", "manifest": {"pdf": {"A4": {"url": "/files/documentation/pdf/18/postgresql-18-A4.pdf", "bytes": 15865106, "pages": 3154, "sha256": "19512c405da53f9f7fcf0abba359223aa65f021be025bf3411381918f92e3190", "built_at": "2026-09-26"}, "US": {"url": "/files/documentation/pdf/18/postgresql-18-US.pdf", "bytes": 15748059, "pages": 3328, "sha256": "facbe6c229e598b872d3d98bef53308f46e06746006fa4590de9a7de9dd46319", "built_at": "2026-09-26"}}, "tree": "18", "index": "index.html", "major": "18", "pages": 1148, "release": "18.6", "source_url": "https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2", "svg_assets": 3, "source_mode": "en SGML built with pinned official archive", "source_sha256": "555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f"}, "revision": "ee8d1a3612338fd9adf250730cb640fcc5233b5491337cc00a316a44e3a0b9f8", "evidence_kind": "English manual and source declarations", "source_sha256": "555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f"}, "sources": [{"url": "/docs/18/app-pgchecksums.html", "file": "app-pgchecksums.html", "label": "18.6 English manual \u00b7 app-pgchecksums.html", "anchor": "", "sha256": "b16216257df55c09f6cc76f43a9c8ac811fda49b3a4490608f936681aa3cd4c2"}, {"url": "/docs/18/reference-server.html", "file": "reference-server.html", "label": "Server applications inventory", "anchor": "", "sha256": "e9f8bbcc8e3641fadd1d20991e8aad6b532155b786ba5a1b7b364ec4f1a5bef3"}], "sections": [], "synopsis": ["pg_checksums [ option ...] [[ -D | --pgdata ] datadir ]"], "signature": "pg_checksums [ option ...] [[ -D | --pgdata ] datadir ]", "description": ["pg_checksums \u2014 enable, disable or check data checksums in a PostgreSQL database cluster"], "environment": [{"name": "PGDATA", "description": "Specifies the directory where the database cluster is stored; can be overridden using the -D option."}, {"name": "PG_COLOR", "description": "Specifies whether to use color in diagnostic messages. Possible values are always , auto and never ."}], "manual_html": "<div><div class=\"refentry\" id=\"APP-PGCHECKSUMS\">\n<div class=\"titlepage\"></div>\n<div class=\"refnamediv\">\n<h2><span class=\"refentrytitle\"><span class=\"application\">pg_checksums</span></span></h2>\n<p>pg_checksums \u2014 enable, disable or check data checksums in a <span class=\"productname\">PostgreSQL</span> database cluster</p>\n</div>\n<div class=\"refsynopsisdiv\">\n<h2>Synopsis</h2>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.5.4.1\"><code class=\"command\">pg_checksums</code> [<em class=\"replaceable\"><code>option</code></em>...] [[ <code class=\"option\">-D</code> | <code class=\"option\">--pgdata</code> ]<em class=\"replaceable\"><code>datadir</code></em>]</p>\n</div>\n</div>\n<div class=\"refsect1\" id=\"R1-APP-PGCHECKSUMS-1\">\n<h2>Description</h2>\n<p><span class=\"application\">pg_checksums</span> checks, enables or disables data checksums in a <span class=\"productname\">PostgreSQL</span> cluster. The server must be shut down cleanly before running <span class=\"application\">pg_checksums</span>. 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.</p>\n<p>When 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 <code class=\"filename\">pg_control</code>.</p>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.5.6\">\n<h2>Options</h2>\n<p>The following command-line options are available:</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-D <em class=\"replaceable\"><code>directory</code></em></code><br></span><span class=\"term\"><code class=\"option\">--pgdata=<em class=\"replaceable\"><code>directory</code></em></code></span></dt>\n<dd>\n<p>Specifies the directory where the database cluster is stored.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-c</code><br></span><span class=\"term\"><code class=\"option\">--check</code></span></dt>\n<dd>\n<p>Checks checksums. This is the default mode if nothing else is specified.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-d</code><br></span><span class=\"term\"><code class=\"option\">--disable</code></span></dt>\n<dd>\n<p>Disables checksums.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-e</code><br></span><span class=\"term\"><code class=\"option\">--enable</code></span></dt>\n<dd>\n<p>Enables checksums.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-f <em class=\"replaceable\"><code>filenode</code></em></code><br></span><span class=\"term\"><code class=\"option\">--filenode=<em class=\"replaceable\"><code>filenode</code></em></code></span></dt>\n<dd>\n<p>Only validate checksums in the relation with filenode <em class=\"replaceable\"><code>filenode</code></em>.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-N</code><br></span><span class=\"term\"><code class=\"option\">--no-sync</code></span></dt>\n<dd>\n<p>By default, <code class=\"command\">pg_checksums</code> will wait for all files to be written safely to disk. This option causes <code class=\"command\">pg_checksums</code> 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 <code class=\"literal\">--check</code>.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-P</code><br></span><span class=\"term\"><code class=\"option\">--progress</code></span></dt>\n<dd>\n<p>Enable progress reporting. Turning this on will deliver a progress report while checking or enabling checksums.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--sync-method=<em class=\"replaceable\"><code>method</code></em></code></span></dt>\n<dd>\n<p>When set to <code class=\"literal\">fsync</code>, which is the default, <code class=\"command\">pg_checksums</code> 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.</p>\n<p>On Linux, <code class=\"literal\">syncfs</code> 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 <a class=\"xref\" href=\"/docs/18/runtime-config-error-handling.html#GUC-RECOVERY-INIT-SYNC-METHOD\">recovery_init_sync_method</a> for information about the caveats to be aware of when using <code class=\"literal\">syncfs</code>.</p>\n<p>This option has no effect when <code class=\"option\">--no-sync</code> is used.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-v</code><br></span><span class=\"term\"><code class=\"option\">--verbose</code></span></dt>\n<dd>\n<p>Enable verbose output. Lists all checked files.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-V</code><br></span><span class=\"term\"><code class=\"option\">--version</code></span></dt>\n<dd>\n<p>Print the <span class=\"application\">pg_checksums</span> version and exit.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-?</code><br></span><span class=\"term\"><code class=\"option\">--help</code></span></dt>\n<dd>\n<p>Show help about <span class=\"application\">pg_checksums</span> command line arguments, and exit.</p>\n</dd>\n</dl>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.5.7\">\n<h2>Environment</h2>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"envar\">PGDATA</code></span></dt>\n<dd>\n<p>Specifies the directory where the database cluster is stored; can be overridden using the <code class=\"option\">-D</code> option.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"envar\">PG_COLOR</code></span></dt>\n<dd>\n<p>Specifies whether to use color in diagnostic messages. Possible values are <code class=\"literal\">always</code>, <code class=\"literal\">auto</code> and <code class=\"literal\">never</code>.</p>\n</dd>\n</dl>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.5.8\">\n<h2>Notes</h2>\n<p>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.</p>\n<p>When using a replication setup with tools which perform direct copies of relation file blocks (for example <a class=\"xref\" href=\"/docs/18/app-pgrewind.html\" title=\"pg_rewind\"><span class=\"refentrytitle\"><span class=\"application\">pg_rewind</span></span></a>), 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.</p>\n<p>If <span class=\"application\">pg_checksums</span> is aborted or killed while enabling or disabling checksums, the cluster's data checksum configuration remains unchanged, and <span class=\"application\">pg_checksums</span> can be re-run to perform the same operation.</p>\n</div>\n</div></div>", "manual_path": "app-pgchecksums.html", "comparison_data": {"options": [{"names": ["-D directory", "--pgdata= directory"], "signature": "-D directory --pgdata= directory", "description": "Specifies the directory where the database cluster is stored."}, {"names": ["-c", "--check"], "signature": "-c --check", "description": "Checks checksums. This is the default mode if nothing else is specified."}, {"names": ["-d", "--disable"], "signature": "-d --disable", "description": "Disables checksums."}, {"names": ["-e", "--enable"], "signature": "-e --enable", "description": "Enables checksums."}, {"names": ["-f filenode", "--filenode= filenode"], "signature": "-f filenode --filenode= filenode", "description": "Only validate checksums in the relation with filenode filenode ."}, {"names": ["-N", "--no-sync"], "signature": "-N --no-sync", "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": ["-P", "--progress"], "signature": "-P --progress", "description": "Enable progress reporting. Turning this on will deliver a progress report while checking or enabling checksums."}, {"names": ["--sync-method= method"], "signature": "--sync-method= method", "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": ["-v", "--verbose"], "signature": "-v --verbose", "description": "Enable verbose output. Lists all checked files."}, {"names": ["-V", "--version"], "signature": "-V --version", "description": "Print the pg_checksums version and exit."}, {"names": ["-?", "--help"], "signature": "-? --help", "description": "Show help about pg_checksums command line arguments, and exit."}], "synopsis": ["pg_checksums [ option ...] [[ -D | --pgdata ] datadir ]"], "environment": [{"name": "PGDATA", "description": "Specifies the directory where the database cluster is stored; can be overridden using the -D option."}, {"name": "PG_COLOR", "description": "Specifies whether to use color in diagnostic messages. Possible values are always , auto and never ."}]}, "comparison_hash": "9df98d0a65050d461414d0c4fc42b1f97bbb808ec68690d4aad884d9b571bb05"}, "19": {"facts": [{"label": "Documented executable", "value": "pg_checksums"}, {"label": "Executable version", "value": "19beta4"}, {"label": "Reference inventory", "value": "Server applications"}, {"label": "Option definition groups", "value": "11"}], "tables": [{"key": "options", "rows": [{"summary": "Specifies the directory where the database cluster is stored.", "signature": {"url": "/docs/19/app-pgchecksums.html", "text": "-D datadir --pgdata= datadir"}}, {"summary": "Checks checksums. This is the default mode if nothing else is specified.", "signature": {"url": "/docs/19/app-pgchecksums.html", "text": "-c --check"}}, {"summary": "Disables checksums.", "signature": {"url": "/docs/19/app-pgchecksums.html", "text": "-d --disable"}}, {"summary": "Enables checksums.", "signature": {"url": "/docs/19/app-pgchecksums.html", "text": "-e --enable"}}, {"summary": "Only validate checksums in the relation with filenode filenode .", "signature": {"url": "/docs/19/app-pgchecksums.html", "text": "-f filenode --filenode= filenode"}}, {"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": {"url": "/docs/19/app-pgchecksums.html", "text": "-N --no-sync"}}, {"summary": "Enable progress reporting. Turning this on will deliver a progress report while checking or enabling checksums.", "signature": {"url": "/docs/19/app-pgchecksums.html", "text": "-P --progress"}}, {"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": {"url": "/docs/19/app-pgchecksums.html", "text": "--sync-method= method"}}, {"summary": "Enable verbose output. Lists all checked files.", "signature": {"url": "/docs/19/app-pgchecksums.html", "text": "-v --verbose"}}, {"summary": "Print the pg_checksums version and exit.", "signature": {"url": "/docs/19/app-pgchecksums.html", "text": "-V --version"}}, {"summary": "Show help about pg_checksums command line arguments, and exit.", "signature": {"url": "/docs/19/app-pgchecksums.html", "text": "-? --help"}}], "title": "Documented options", "columns": [{"key": "signature", "label": "Option and arguments"}, {"key": "summary", "label": "Description"}]}, {"key": "environment", "rows": [{"name": "PGDATA", "description": "Specifies the directory where the database cluster is stored; can be overridden using the -D option."}, {"name": "PG_COLOR", "description": "Specifies whether to use color in diagnostic messages. Possible values are always , auto and never ."}], "title": "Environment variables", "columns": [{"key": "name", "label": "Variable"}, {"key": "description", "label": "Meaning"}]}], "options": [{"names": ["-D datadir", "--pgdata= datadir"], "summary": "Specifies the directory where the database cluster is stored.", "signature": "-D datadir --pgdata= datadir", "source_url": "/docs/19/app-pgchecksums.html", "description": "Specifies the directory where the database cluster is stored."}, {"names": ["-c", "--check"], "summary": "Checks checksums. This is the default mode if nothing else is specified.", "signature": "-c --check", "source_url": "/docs/19/app-pgchecksums.html", "description": "Checks checksums. This is the default mode if nothing else is specified."}, {"names": ["-d", "--disable"], "summary": "Disables checksums.", "signature": "-d --disable", "source_url": "/docs/19/app-pgchecksums.html", "description": "Disables checksums."}, {"names": ["-e", "--enable"], "summary": "Enables checksums.", "signature": "-e --enable", "source_url": "/docs/19/app-pgchecksums.html", "description": "Enables checksums."}, {"names": ["-f filenode", "--filenode= filenode"], "summary": "Only validate checksums in the relation with filenode filenode .", "signature": "-f filenode --filenode= filenode", "source_url": "/docs/19/app-pgchecksums.html", "description": "Only validate checksums in the relation with filenode filenode ."}, {"names": ["-N", "--no-sync"], "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": "-N --no-sync", "source_url": "/docs/19/app-pgchecksums.html", "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": ["-P", "--progress"], "summary": "Enable progress reporting. Turning this on will deliver a progress report while checking or enabling checksums.", "signature": "-P --progress", "source_url": "/docs/19/app-pgchecksums.html", "description": "Enable progress reporting. Turning this on will deliver a progress report while checking or enabling checksums."}, {"names": ["--sync-method= method"], "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": "--sync-method= method", "source_url": "/docs/19/app-pgchecksums.html", "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": ["-v", "--verbose"], "summary": "Enable verbose output. Lists all checked files.", "signature": "-v --verbose", "source_url": "/docs/19/app-pgchecksums.html", "description": "Enable verbose output. Lists all checked files."}, {"names": ["-V", "--version"], "summary": "Print the pg_checksums version and exit.", "signature": "-V --version", "source_url": "/docs/19/app-pgchecksums.html", "description": "Print the pg_checksums version and exit."}, {"names": ["-?", "--help"], "summary": "Show help about pg_checksums command line arguments, and exit.", "signature": "-? --help", "source_url": "/docs/19/app-pgchecksums.html", "description": "Show help about pg_checksums command line arguments, and exit."}], "related": [], "release": {"ref": "https://ftp.postgresql.org/pub/source/v19beta4/postgresql-19beta4.tar.bz2", "label": "19beta4", "major": "19", "channel": "preview", "manifest": {"pdf": {"A4": {"url": "/files/documentation/pdf/19/postgresql-19-A4.pdf", "bytes": 16064841, "pages": 3052, "sha256": "4dd099e4125c591128fc5f3ebd02178dc24781f9e5ae629f96d67c4c8547427b", "built_at": "2026-09-26"}, "US": {"url": "/files/documentation/pdf/19/postgresql-19-US.pdf", "bytes": 15974616, "pages": 3225, "sha256": "61971fa857f0956d47341a0388fa6af9ae10acf691d4b2fc009007d384b0342b", "built_at": "2026-09-26"}}, "tree": "19", "index": "index.html", "major": "19", "pages": 1155, "release": "19beta4", "source_url": "https://ftp.postgresql.org/pub/source/v19beta4/postgresql-19beta4.tar.bz2", "svg_assets": 5, "source_mode": "en SGML built with pinned official archive", "source_sha256": "83157ee9c599d03b2f7a3d73ef3a56ec24e0e79cc2b3501a64d1364f56398c86"}, "revision": "1bbbbf4133d426f0e4304010688d2984c30fb67df0cc3a61b3e37eb3f6f37833", "evidence_kind": "English manual and source declarations", "source_sha256": "83157ee9c599d03b2f7a3d73ef3a56ec24e0e79cc2b3501a64d1364f56398c86"}, "sources": [{"url": "/docs/19/app-pgchecksums.html", "file": "app-pgchecksums.html", "label": "19beta4 English manual \u00b7 app-pgchecksums.html", "anchor": "", "sha256": "dd9067d67ff9ed5993cf25f73b71d393f56a7d0ab93ec23873e2ef2c5a83f96d"}, {"url": "/docs/19/reference-server.html", "file": "reference-server.html", "label": "Server applications inventory", "anchor": "", "sha256": "425b070323b448b5516d2cb4e9e4ac77efb5d19dd4e8005d0ae1c61db9ec78e6"}], "sections": [], "synopsis": ["pg_checksums [ option ...] [ [ -D | --pgdata ] datadir ]"], "signature": "pg_checksums [ option ...] [ [ -D | --pgdata ] datadir ]", "description": ["pg_checksums \u2014 enable, disable or check data checksums in a PostgreSQL database cluster"], "environment": [{"name": "PGDATA", "description": "Specifies the directory where the database cluster is stored; can be overridden using the -D option."}, {"name": "PG_COLOR", "description": "Specifies whether to use color in diagnostic messages. Possible values are always , auto and never ."}], "manual_html": "<div><div class=\"refentry\" id=\"APP-PGCHECKSUMS\">\n<div class=\"titlepage\"></div>\n<div class=\"refnamediv\">\n<h2><span class=\"refentrytitle\"><span class=\"application\">pg_checksums</span></span></h2>\n<p>pg_checksums \u2014 enable, disable or check data checksums in a <span class=\"productname\">PostgreSQL</span> database cluster</p>\n</div>\n<div class=\"refsynopsisdiv\">\n<h2>Synopsis</h2>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.5.4.1\"><code class=\"command\">pg_checksums</code> [<em class=\"replaceable\"><code>option</code></em>...] [ [ <code class=\"option\">-D</code> | <code class=\"option\">--pgdata</code> ] <em class=\"replaceable\"><code>datadir</code></em> ]</p>\n</div>\n</div>\n<div class=\"refsect1\" id=\"R1-APP-PGCHECKSUMS-1\">\n<h2>Description</h2>\n<p><span class=\"application\">pg_checksums</span> checks, enables or disables data checksums in a <span class=\"productname\">PostgreSQL</span> cluster. The server must be shut down cleanly before running <span class=\"application\">pg_checksums</span>. See <a class=\"xref\" href=\"/docs/19/checksums.html\" title=\"28.2.\u00a0Data Checksums\">Section\u00a028.2</a> for further details on data checksums. 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.</p>\n<p>When 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 <code class=\"filename\">pg_control</code>.</p>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.5.6\">\n<h2>Options</h2>\n<p>The following command-line options are available:</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-D <em class=\"replaceable\"><code>datadir</code></em></code><br></span><span class=\"term\"><code class=\"option\">--pgdata=<em class=\"replaceable\"><code>datadir</code></em></code></span></dt>\n<dd>\n<p>Specifies the directory where the database cluster is stored.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-c</code><br></span><span class=\"term\"><code class=\"option\">--check</code></span></dt>\n<dd>\n<p>Checks checksums. This is the default mode if nothing else is specified.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-d</code><br></span><span class=\"term\"><code class=\"option\">--disable</code></span></dt>\n<dd>\n<p>Disables checksums.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-e</code><br></span><span class=\"term\"><code class=\"option\">--enable</code></span></dt>\n<dd>\n<p>Enables checksums.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-f <em class=\"replaceable\"><code>filenode</code></em></code><br></span><span class=\"term\"><code class=\"option\">--filenode=<em class=\"replaceable\"><code>filenode</code></em></code></span></dt>\n<dd>\n<p>Only validate checksums in the relation with filenode <em class=\"replaceable\"><code>filenode</code></em>.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-N</code><br></span><span class=\"term\"><code class=\"option\">--no-sync</code></span></dt>\n<dd>\n<p>By default, <code class=\"command\">pg_checksums</code> will wait for all files to be written safely to disk. This option causes <code class=\"command\">pg_checksums</code> 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 <code class=\"literal\">--check</code>.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-P</code><br></span><span class=\"term\"><code class=\"option\">--progress</code></span></dt>\n<dd>\n<p>Enable progress reporting. Turning this on will deliver a progress report while checking or enabling checksums.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--sync-method=<em class=\"replaceable\"><code>method</code></em></code></span></dt>\n<dd>\n<p>When set to <code class=\"literal\">fsync</code>, which is the default, <code class=\"command\">pg_checksums</code> 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.</p>\n<p>On Linux, <code class=\"literal\">syncfs</code> 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 <a class=\"xref\" href=\"/docs/19/runtime-config-error-handling.html#GUC-RECOVERY-INIT-SYNC-METHOD\">recovery_init_sync_method</a> for information about the caveats to be aware of when using <code class=\"literal\">syncfs</code>.</p>\n<p>This option has no effect when <code class=\"option\">--no-sync</code> is used.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-v</code><br></span><span class=\"term\"><code class=\"option\">--verbose</code></span></dt>\n<dd>\n<p>Enable verbose output. Lists all checked files.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-V</code><br></span><span class=\"term\"><code class=\"option\">--version</code></span></dt>\n<dd>\n<p>Print the <span class=\"application\">pg_checksums</span> version and exit.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-?</code><br></span><span class=\"term\"><code class=\"option\">--help</code></span></dt>\n<dd>\n<p>Show help about <span class=\"application\">pg_checksums</span> command line arguments, and exit.</p>\n</dd>\n</dl>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.5.7\">\n<h2>Environment</h2>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"envar\">PGDATA</code></span></dt>\n<dd>\n<p>Specifies the directory where the database cluster is stored; can be overridden using the <code class=\"option\">-D</code> option.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"envar\">PG_COLOR</code></span></dt>\n<dd>\n<p>Specifies whether to use color in diagnostic messages. Possible values are <code class=\"literal\">always</code>, <code class=\"literal\">auto</code> and <code class=\"literal\">never</code>.</p>\n</dd>\n</dl>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.5.8\">\n<h2>Notes</h2>\n<p>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.</p>\n<p>When using a replication setup with tools which perform direct copies of relation file blocks (for example <a class=\"xref\" href=\"/docs/19/app-pgrewind.html\" title=\"pg_rewind\"><span class=\"refentrytitle\"><span class=\"application\">pg_rewind</span></span></a>), 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.</p>\n<p>If <span class=\"application\">pg_checksums</span> is aborted or killed while enabling or disabling checksums, the cluster's data checksum configuration remains unchanged, and <span class=\"application\">pg_checksums</span> can be re-run to perform the same operation.</p>\n<p>The target cluster must have the same major version as <span class=\"application\">pg_checksums</span>.</p>\n</div>\n</div></div>", "manual_path": "app-pgchecksums.html", "comparison_data": {"options": [{"names": ["-D datadir", "--pgdata= datadir"], "signature": "-D datadir --pgdata= datadir", "description": "Specifies the directory where the database cluster is stored."}, {"names": ["-c", "--check"], "signature": "-c --check", "description": "Checks checksums. This is the default mode if nothing else is specified."}, {"names": ["-d", "--disable"], "signature": "-d --disable", "description": "Disables checksums."}, {"names": ["-e", "--enable"], "signature": "-e --enable", "description": "Enables checksums."}, {"names": ["-f filenode", "--filenode= filenode"], "signature": "-f filenode --filenode= filenode", "description": "Only validate checksums in the relation with filenode filenode ."}, {"names": ["-N", "--no-sync"], "signature": "-N --no-sync", "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": ["-P", "--progress"], "signature": "-P --progress", "description": "Enable progress reporting. Turning this on will deliver a progress report while checking or enabling checksums."}, {"names": ["--sync-method= method"], "signature": "--sync-method= method", "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": ["-v", "--verbose"], "signature": "-v --verbose", "description": "Enable verbose output. Lists all checked files."}, {"names": ["-V", "--version"], "signature": "-V --version", "description": "Print the pg_checksums version and exit."}, {"names": ["-?", "--help"], "signature": "-? --help", "description": "Show help about pg_checksums command line arguments, and exit."}], "synopsis": ["pg_checksums [ option ...] [ [ -D | --pgdata ] datadir ]"], "environment": [{"name": "PGDATA", "description": "Specifies the directory where the database cluster is stored; can be overridden using the -D option."}, {"name": "PG_COLOR", "description": "Specifies whether to use color in diagnostic messages. Possible values are always , auto and never ."}]}, "comparison_hash": "b78f786be12c8dfb559cec46b186c2035be9748e1a181f507423aca26d8746fb"}, "20": {"facts": [{"label": "Documented executable", "value": "pg_checksums"}, {"label": "Executable version", "value": "20devel"}, {"label": "Reference inventory", "value": "Server applications"}, {"label": "Option definition groups", "value": "11"}], "tables": [{"key": "options", "rows": [{"summary": "Specifies the directory where the database cluster is stored.", "signature": {"url": "/docs/devel/app-pgchecksums.html", "text": "-D datadir --pgdata= datadir"}}, {"summary": "Checks checksums. This is the default mode if nothing else is specified.", "signature": {"url": "/docs/devel/app-pgchecksums.html", "text": "-c --check"}}, {"summary": "Disables checksums.", "signature": {"url": "/docs/devel/app-pgchecksums.html", "text": "-d --disable"}}, {"summary": "Enables checksums.", "signature": {"url": "/docs/devel/app-pgchecksums.html", "text": "-e --enable"}}, {"summary": "Only validate checksums in the relation with filenode filenode .", "signature": {"url": "/docs/devel/app-pgchecksums.html", "text": "-f filenode --filenode= filenode"}}, {"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": {"url": "/docs/devel/app-pgchecksums.html", "text": "-N --no-sync"}}, {"summary": "Enable progress reporting. Turning this on will deliver a progress report while checking or enabling checksums.", "signature": {"url": "/docs/devel/app-pgchecksums.html", "text": "-P --progress"}}, {"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": {"url": "/docs/devel/app-pgchecksums.html", "text": "--sync-method= method"}}, {"summary": "Enable verbose output. Lists all checked files.", "signature": {"url": "/docs/devel/app-pgchecksums.html", "text": "-v --verbose"}}, {"summary": "Print the pg_checksums version and exit.", "signature": {"url": "/docs/devel/app-pgchecksums.html", "text": "-V --version"}}, {"summary": "Show help about pg_checksums command line arguments, and exit.", "signature": {"url": "/docs/devel/app-pgchecksums.html", "text": "-? --help"}}], "title": "Documented options", "columns": [{"key": "signature", "label": "Option and arguments"}, {"key": "summary", "label": "Description"}]}, {"key": "environment", "rows": [{"name": "PGDATA", "description": "Specifies the directory where the database cluster is stored; can be overridden using the -D option."}, {"name": "PG_COLOR", "description": "Specifies whether to use color in diagnostic messages. Possible values are always , auto and never ."}], "title": "Environment variables", "columns": [{"key": "name", "label": "Variable"}, {"key": "description", "label": "Meaning"}]}], "options": [{"names": ["-D datadir", "--pgdata= datadir"], "summary": "Specifies the directory where the database cluster is stored.", "signature": "-D datadir --pgdata= datadir", "source_url": "/docs/devel/app-pgchecksums.html", "description": "Specifies the directory where the database cluster is stored."}, {"names": ["-c", "--check"], "summary": "Checks checksums. This is the default mode if nothing else is specified.", "signature": "-c --check", "source_url": "/docs/devel/app-pgchecksums.html", "description": "Checks checksums. This is the default mode if nothing else is specified."}, {"names": ["-d", "--disable"], "summary": "Disables checksums.", "signature": "-d --disable", "source_url": "/docs/devel/app-pgchecksums.html", "description": "Disables checksums."}, {"names": ["-e", "--enable"], "summary": "Enables checksums.", "signature": "-e --enable", "source_url": "/docs/devel/app-pgchecksums.html", "description": "Enables checksums."}, {"names": ["-f filenode", "--filenode= filenode"], "summary": "Only validate checksums in the relation with filenode filenode .", "signature": "-f filenode --filenode= filenode", "source_url": "/docs/devel/app-pgchecksums.html", "description": "Only validate checksums in the relation with filenode filenode ."}, {"names": ["-N", "--no-sync"], "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": "-N --no-sync", "source_url": "/docs/devel/app-pgchecksums.html", "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": ["-P", "--progress"], "summary": "Enable progress reporting. Turning this on will deliver a progress report while checking or enabling checksums.", "signature": "-P --progress", "source_url": "/docs/devel/app-pgchecksums.html", "description": "Enable progress reporting. Turning this on will deliver a progress report while checking or enabling checksums."}, {"names": ["--sync-method= method"], "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": "--sync-method= method", "source_url": "/docs/devel/app-pgchecksums.html", "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": ["-v", "--verbose"], "summary": "Enable verbose output. Lists all checked files.", "signature": "-v --verbose", "source_url": "/docs/devel/app-pgchecksums.html", "description": "Enable verbose output. Lists all checked files."}, {"names": ["-V", "--version"], "summary": "Print the pg_checksums version and exit.", "signature": "-V --version", "source_url": "/docs/devel/app-pgchecksums.html", "description": "Print the pg_checksums version and exit."}, {"names": ["-?", "--help"], "summary": "Show help about pg_checksums command line arguments, and exit.", "signature": "-? --help", "source_url": "/docs/devel/app-pgchecksums.html", "description": "Show help about pg_checksums command line arguments, and exit."}], "related": [], "release": {"ref": "https://ftp.postgresql.org/pub/snapshot/dev/postgresql-snapshot.tar.bz2", "label": "20devel", "major": "20", "channel": "devel", "manifest": {"pdf": {"A4": {"url": "/files/documentation/pdf/20/postgresql-20-A4.pdf", "bytes": 16030631, "pages": 3052, "sha256": "bd5d82c0ce38fc18f92a0447818a91a193a261776bca1c37564bf9a683e177d0", "built_at": "2026-09-28"}, "US": {"url": "/files/documentation/pdf/20/postgresql-20-US.pdf", "bytes": 15936613, "pages": 3223, "sha256": "d97d9e0db479a02f4234b175f50fcad70c3661619afc8d6df9b9437882e3c299", "built_at": "2026-09-28"}}, "tree": "0", "index": "index.html", "major": "20", "pages": 1156, "release": "20devel", "source_url": "https://ftp.postgresql.org/pub/snapshot/dev/postgresql-snapshot.tar.bz2", "svg_assets": 6, "source_mode": "en SGML built with pinned official archive", "source_sha256": "4d3346909b201ac1648232cf290462a7070c119326f56196f1f0253ed80fae41", "source_snapshot_utc": "26-Sep-2026 20:22"}, "revision": "2eba5e0fd4c3bffb2803247b6cd537878e9d6ee5a6dfbe3c50ece8b421b80918", "evidence_kind": "English manual and source declarations", "source_sha256": "4d3346909b201ac1648232cf290462a7070c119326f56196f1f0253ed80fae41"}, "sources": [{"url": "/docs/devel/app-pgchecksums.html", "file": "app-pgchecksums.html", "label": "20devel English manual \u00b7 app-pgchecksums.html", "anchor": "", "sha256": "b884c32f34255d468bf249cf449169cf42e8321b2956409f70ffefa4ea42bd08"}, {"url": "/docs/devel/reference-server.html", "file": "reference-server.html", "label": "Server applications inventory", "anchor": "", "sha256": "5532c1ebfb8c6f310301be63a28daf0ae212e2a78025bea61a1bdca99e02c43d"}], "sections": [], "synopsis": ["pg_checksums [ option ...] [ [ -D | --pgdata ] datadir ]"], "signature": "pg_checksums [ option ...] [ [ -D | --pgdata ] datadir ]", "description": ["pg_checksums \u2014 enable, disable or check data checksums in a PostgreSQL database cluster"], "environment": [{"name": "PGDATA", "description": "Specifies the directory where the database cluster is stored; can be overridden using the -D option."}, {"name": "PG_COLOR", "description": "Specifies whether to use color in diagnostic messages. Possible values are always , auto and never ."}], "manual_html": "<div><div class=\"refentry\" id=\"APP-PGCHECKSUMS\">\n<div class=\"titlepage\"></div>\n<div class=\"refnamediv\">\n<h2><span class=\"refentrytitle\"><span class=\"application\">pg_checksums</span></span></h2>\n<p>pg_checksums \u2014 enable, disable or check data checksums in a <span class=\"productname\">PostgreSQL</span> database cluster</p>\n</div>\n<div class=\"refsynopsisdiv\">\n<h2>Synopsis</h2>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.5.4.1\"><code class=\"command\">pg_checksums</code> [<em class=\"replaceable\"><code>option</code></em>...] [ [ <code class=\"option\">-D</code> | <code class=\"option\">--pgdata</code> ] <em class=\"replaceable\"><code>datadir</code></em> ]</p>\n</div>\n</div>\n<div class=\"refsect1\" id=\"R1-APP-PGCHECKSUMS-1\">\n<h2>Description</h2>\n<p><span class=\"application\">pg_checksums</span> checks, enables or disables data checksums in a <span class=\"productname\">PostgreSQL</span> cluster. The server must be shut down cleanly before running <span class=\"application\">pg_checksums</span>. Checksums can also be enabled while the cluster is running using <a class=\"xref\" href=\"/docs/devel/checksums.html#CHECKSUMS-ONLINE-ENABLE-DISABLE\" title=\"28.2.2.\u00a0Online Enabling of Checksums\">Online Enabling of Checksums</a> processing, see <a class=\"xref\" href=\"/docs/devel/checksums.html\" title=\"28.2.\u00a0Data Checksums\">Section\u00a028.2</a> for further details on the different approaches. 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.</p>\n<p>If checksums were in the process of being enabled or disabled using <a class=\"xref\" href=\"/docs/devel/checksums.html#CHECKSUMS-ONLINE-ENABLE-DISABLE\" title=\"28.2.2.\u00a0Online Enabling of Checksums\">Online Enabling of Checksums</a> when the cluster was shut down, the control file still records that interrupted state, and <span class=\"application\">pg_checksums</span> refuses to run in any mode. Start the cluster and shut it down cleanly to reset the state, then retry; on a standby, let replication complete the transition first.</p>\n<p>When 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 <code class=\"filename\">pg_control</code>.</p>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.5.6\">\n<h2>Options</h2>\n<p>The following command-line options are available:</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-D <em class=\"replaceable\"><code>datadir</code></em></code><br></span><span class=\"term\"><code class=\"option\">--pgdata=<em class=\"replaceable\"><code>datadir</code></em></code></span></dt>\n<dd>\n<p>Specifies the directory where the database cluster is stored.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-c</code><br></span><span class=\"term\"><code class=\"option\">--check</code></span></dt>\n<dd>\n<p>Checks checksums. This is the default mode if nothing else is specified.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-d</code><br></span><span class=\"term\"><code class=\"option\">--disable</code></span></dt>\n<dd>\n<p>Disables checksums.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-e</code><br></span><span class=\"term\"><code class=\"option\">--enable</code></span></dt>\n<dd>\n<p>Enables checksums.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-f <em class=\"replaceable\"><code>filenode</code></em></code><br></span><span class=\"term\"><code class=\"option\">--filenode=<em class=\"replaceable\"><code>filenode</code></em></code></span></dt>\n<dd>\n<p>Only validate checksums in the relation with filenode <em class=\"replaceable\"><code>filenode</code></em>.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-N</code><br></span><span class=\"term\"><code class=\"option\">--no-sync</code></span></dt>\n<dd>\n<p>By default, <code class=\"command\">pg_checksums</code> will wait for all files to be written safely to disk. This option causes <code class=\"command\">pg_checksums</code> 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 <code class=\"literal\">--check</code>.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-P</code><br></span><span class=\"term\"><code class=\"option\">--progress</code></span></dt>\n<dd>\n<p>Enable progress reporting. Turning this on will deliver a progress report while checking or enabling checksums.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--sync-method=<em class=\"replaceable\"><code>method</code></em></code></span></dt>\n<dd>\n<p>When set to <code class=\"literal\">fsync</code>, which is the default, <code class=\"command\">pg_checksums</code> 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.</p>\n<p>On Linux, <code class=\"literal\">syncfs</code> 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 <a class=\"xref\" href=\"/docs/devel/runtime-config-error-handling.html#GUC-RECOVERY-INIT-SYNC-METHOD\">recovery_init_sync_method</a> for information about the caveats to be aware of when using <code class=\"literal\">syncfs</code>.</p>\n<p>This option has no effect when <code class=\"option\">--no-sync</code> is used.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-v</code><br></span><span class=\"term\"><code class=\"option\">--verbose</code></span></dt>\n<dd>\n<p>Enable verbose output. Lists all checked files.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-V</code><br></span><span class=\"term\"><code class=\"option\">--version</code></span></dt>\n<dd>\n<p>Print the <span class=\"application\">pg_checksums</span> version and exit.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-?</code><br></span><span class=\"term\"><code class=\"option\">--help</code></span></dt>\n<dd>\n<p>Show help about <span class=\"application\">pg_checksums</span> command line arguments, and exit.</p>\n</dd>\n</dl>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.5.7\">\n<h2>Environment</h2>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"envar\">PGDATA</code></span></dt>\n<dd>\n<p>Specifies the directory where the database cluster is stored; can be overridden using the <code class=\"option\">-D</code> option.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"envar\">PG_COLOR</code></span></dt>\n<dd>\n<p>Specifies whether to use color in diagnostic messages. Possible values are <code class=\"literal\">always</code>, <code class=\"literal\">auto</code> and <code class=\"literal\">never</code>.</p>\n</dd>\n</dl>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.5.8\">\n<h2>Notes</h2>\n<p>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.</p>\n<p>Enabling or disabling checksums with <span class=\"application\">pg_checksums</span> changes only the local data directory; the new state is not replicated to any other node. In a replication setup the same change must be applied to every node:</p>\n<div class=\"procedure\">\n<ol class=\"procedure\">\n<li class=\"step\" id=\"SHUT-DOWN-NODES\">\n<p class=\"title\"><strong>Shut down all nodes</strong></p>\n<p>All nodes participating in the replication must be stopped with a clean shutdown; <span class=\"application\">pg_checksums</span> refuses to run on a data directory left behind by an immediate shutdown. Before stopping a standby, make sure it has replayed all WAL of the primary: stop the primary first, read its <span class=\"quote\">\u201c<span class=\"quote\">Latest checkpoint location</span>\u201d</span> with <a class=\"xref\" href=\"/docs/devel/app-pgcontroldata.html\" title=\"pg_controldata\"><span class=\"refentrytitle\"><span class=\"application\">pg_controldata</span></span></a>, and check that <code class=\"function\">pg_last_wal_replay_lsn()</code> on the standby has advanced past it. Comparing the replay position with <code class=\"function\">pg_last_wal_receive_lsn()</code> is not enough, as it only shows that the WAL the standby received has been replayed.</p>\n</li>\n<li class=\"step\">\n<p class=\"title\"><strong>Enable or disable data checksums on each node</strong></p>\n<p>Run <span class=\"application\">pg_checksums</span> on the data directory of each node in the replication setup. Nodes can be processed in parallel while they are shut down. Processing must complete successfully on all nodes before continuing.</p>\n</li>\n<li class=\"step\">\n<p class=\"title\"><strong>Restart all nodes</strong></p>\n<p>Start the nodes normally, verify that <a class=\"xref\" href=\"/docs/devel/runtime-config-preset.html#GUC-DATA-CHECKSUMS\">data_checksums</a> matches on all of them, and monitor the logs of the standbys for data checksum state mismatch warnings.</p>\n</li>\n</ol>\n</div>\n<p>The replay requirement in <a class=\"xref\" href=\"/docs/devel/app-pgchecksums.html#SHUT-DOWN-NODES\" title=\"Shut down all nodes\">Step 1</a> exists because an offline change is recorded only in the control file and has no defined ordering against WAL the node has not replayed yet; see <a class=\"xref\" href=\"/docs/devel/checksums.html#CHECKSUMS-OFFLINE-ENABLE-DISABLE\" title=\"28.2.1.\u00a0Offline Enabling of Checksums\">Section\u00a028.2.1</a>. A node stopped before replaying an online checksum state change applies that change when it is restarted, overriding the offline change, and the states of the nodes silently diverge until a later checkpoint record triggers the warning described below. Because of this it is best not to mix the two mechanisms: change the state of a replication setup either with the offline procedure above or with an online transition, and make sure the previous change has reached every node before starting the next one.</p>\n<p>If the change is applied inconsistently, each node keeps its own state, and a standby logs a warning when the state recorded in the replayed WAL differs from its own. The same warning can appear transiently while a standby catches up over WAL written before a consistent change; it stops once a checkpoint record carrying the new state has been replayed.</p>\n<p>A standby whose data directory was never checksummed must not have checksums enabled by catching up this way. Converge the cluster by running <span class=\"application\">pg_checksums</span> on it while stopped as outlined above, by enabling checksums online, or by recreating it from a base backup. Note that an online enable only starts from a primary whose checksums are off, so if they are already enabled there, disable them online first.</p>\n<p>If <span class=\"application\">pg_checksums</span> is aborted or killed while enabling or disabling checksums, the cluster's data checksum configuration remains unchanged, and <span class=\"application\">pg_checksums</span> can be re-run to perform the same operation.</p>\n<p>Tools that copy relation file blocks directly between nodes, such as <a class=\"xref\" href=\"/docs/devel/app-pgrewind.html\" title=\"pg_rewind\"><span class=\"refentrytitle\"><span class=\"application\">pg_rewind</span></span></a>, require all nodes to be in the same data checksum state, else there is risk for data corruption.</p>\n<p>The target cluster must have the same major version as <span class=\"application\">pg_checksums</span>.</p>\n</div>\n</div></div>", "manual_path": "app-pgchecksums.html", "comparison_data": {"options": [{"names": ["-D datadir", "--pgdata= datadir"], "signature": "-D datadir --pgdata= datadir", "description": "Specifies the directory where the database cluster is stored."}, {"names": ["-c", "--check"], "signature": "-c --check", "description": "Checks checksums. This is the default mode if nothing else is specified."}, {"names": ["-d", "--disable"], "signature": "-d --disable", "description": "Disables checksums."}, {"names": ["-e", "--enable"], "signature": "-e --enable", "description": "Enables checksums."}, {"names": ["-f filenode", "--filenode= filenode"], "signature": "-f filenode --filenode= filenode", "description": "Only validate checksums in the relation with filenode filenode ."}, {"names": ["-N", "--no-sync"], "signature": "-N --no-sync", "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": ["-P", "--progress"], "signature": "-P --progress", "description": "Enable progress reporting. Turning this on will deliver a progress report while checking or enabling checksums."}, {"names": ["--sync-method= method"], "signature": "--sync-method= method", "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": ["-v", "--verbose"], "signature": "-v --verbose", "description": "Enable verbose output. Lists all checked files."}, {"names": ["-V", "--version"], "signature": "-V --version", "description": "Print the pg_checksums version and exit."}, {"names": ["-?", "--help"], "signature": "-? --help", "description": "Show help about pg_checksums command line arguments, and exit."}], "synopsis": ["pg_checksums [ option ...] [ [ -D | --pgdata ] datadir ]"], "environment": [{"name": "PGDATA", "description": "Specifies the directory where the database cluster is stored; can be overridden using the -D option."}, {"name": "PG_COLOR", "description": "Specifies whether to use color in diagnostic messages. Possible values are always , auto and never ."}]}, "comparison_hash": "b78f786be12c8dfb559cec46b186c2035be9748e1a181f507423aca26d8746fb"}}}, "snapshot": {"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"}], "tables": [{"key": "options", "rows": [{"summary": "Specifies the directory where the database cluster is stored.", "signature": {"url": "/docs/18/app-pgchecksums.html", "text": "-D directory --pgdata= directory"}}, {"summary": "Checks checksums. This is the default mode if nothing else is specified.", "signature": {"url": "/docs/18/app-pgchecksums.html", "text": "-c --check"}}, {"summary": "Disables checksums.", "signature": {"url": "/docs/18/app-pgchecksums.html", "text": "-d --disable"}}, {"summary": "Enables checksums.", "signature": {"url": "/docs/18/app-pgchecksums.html", "text": "-e --enable"}}, {"summary": "Only validate checksums in the relation with filenode filenode .", "signature": {"url": "/docs/18/app-pgchecksums.html", "text": "-f filenode --filenode= filenode"}}, {"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": {"url": "/docs/18/app-pgchecksums.html", "text": "-N --no-sync"}}, {"summary": "Enable progress reporting. Turning this on will deliver a progress report while checking or enabling checksums.", "signature": {"url": "/docs/18/app-pgchecksums.html", "text": "-P --progress"}}, {"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": {"url": "/docs/18/app-pgchecksums.html", "text": "--sync-method= method"}}, {"summary": "Enable verbose output. Lists all checked files.", "signature": {"url": "/docs/18/app-pgchecksums.html", "text": "-v --verbose"}}, {"summary": "Print the pg_checksums version and exit.", "signature": {"url": "/docs/18/app-pgchecksums.html", "text": "-V --version"}}, {"summary": "Show help about pg_checksums command line arguments, and exit.", "signature": {"url": "/docs/18/app-pgchecksums.html", "text": "-? --help"}}], "title": "Documented options", "columns": [{"key": "signature", "label": "Option and arguments"}, {"key": "summary", "label": "Description"}]}, {"key": "environment", "rows": [{"name": "PGDATA", "description": "Specifies the directory where the database cluster is stored; can be overridden using the -D option."}, {"name": "PG_COLOR", "description": "Specifies whether to use color in diagnostic messages. Possible values are always , auto and never ."}], "title": "Environment variables", "columns": [{"key": "name", "label": "Variable"}, {"key": "description", "label": "Meaning"}]}], "options": [{"names": ["-D directory", "--pgdata= directory"], "summary": "Specifies the directory where the database cluster is stored.", "signature": "-D directory --pgdata= directory", "source_url": "/docs/18/app-pgchecksums.html", "description": "Specifies the directory where the database cluster is stored."}, {"names": ["-c", "--check"], "summary": "Checks checksums. This is the default mode if nothing else is specified.", "signature": "-c --check", "source_url": "/docs/18/app-pgchecksums.html", "description": "Checks checksums. This is the default mode if nothing else is specified."}, {"names": ["-d", "--disable"], "summary": "Disables checksums.", "signature": "-d --disable", "source_url": "/docs/18/app-pgchecksums.html", "description": "Disables checksums."}, {"names": ["-e", "--enable"], "summary": "Enables checksums.", "signature": "-e --enable", "source_url": "/docs/18/app-pgchecksums.html", "description": "Enables checksums."}, {"names": ["-f filenode", "--filenode= filenode"], "summary": "Only validate checksums in the relation with filenode filenode .", "signature": "-f filenode --filenode= filenode", "source_url": "/docs/18/app-pgchecksums.html", "description": "Only validate checksums in the relation with filenode filenode ."}, {"names": ["-N", "--no-sync"], "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": "-N --no-sync", "source_url": "/docs/18/app-pgchecksums.html", "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": ["-P", "--progress"], "summary": "Enable progress reporting. Turning this on will deliver a progress report while checking or enabling checksums.", "signature": "-P --progress", "source_url": "/docs/18/app-pgchecksums.html", "description": "Enable progress reporting. Turning this on will deliver a progress report while checking or enabling checksums."}, {"names": ["--sync-method= method"], "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": "--sync-method= method", "source_url": "/docs/18/app-pgchecksums.html", "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": ["-v", "--verbose"], "summary": "Enable verbose output. Lists all checked files.", "signature": "-v --verbose", "source_url": "/docs/18/app-pgchecksums.html", "description": "Enable verbose output. Lists all checked files."}, {"names": ["-V", "--version"], "summary": "Print the pg_checksums version and exit.", "signature": "-V --version", "source_url": "/docs/18/app-pgchecksums.html", "description": "Print the pg_checksums version and exit."}, {"names": ["-?", "--help"], "summary": "Show help about pg_checksums command line arguments, and exit.", "signature": "-? --help", "source_url": "/docs/18/app-pgchecksums.html", "description": "Show help about pg_checksums command line arguments, and exit."}], "related": [], "release": {"ref": "https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2", "label": "18.6", "major": "18", "channel": "stable", "manifest": {"pdf": {"A4": {"url": "/files/documentation/pdf/18/postgresql-18-A4.pdf", "bytes": 15865106, "pages": 3154, "sha256": "19512c405da53f9f7fcf0abba359223aa65f021be025bf3411381918f92e3190", "built_at": "2026-09-26"}, "US": {"url": "/files/documentation/pdf/18/postgresql-18-US.pdf", "bytes": 15748059, "pages": 3328, "sha256": "facbe6c229e598b872d3d98bef53308f46e06746006fa4590de9a7de9dd46319", "built_at": "2026-09-26"}}, "tree": "18", "index": "index.html", "major": "18", "pages": 1148, "release": "18.6", "source_url": "https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2", "svg_assets": 3, "source_mode": "en SGML built with pinned official archive", "source_sha256": "555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f"}, "revision": "ee8d1a3612338fd9adf250730cb640fcc5233b5491337cc00a316a44e3a0b9f8", "evidence_kind": "English manual and source declarations", "source_sha256": "555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f"}, "sources": [{"url": "/docs/18/app-pgchecksums.html", "file": "app-pgchecksums.html", "label": "18.6 English manual \u00b7 app-pgchecksums.html", "anchor": "", "sha256": "b16216257df55c09f6cc76f43a9c8ac811fda49b3a4490608f936681aa3cd4c2"}, {"url": "/docs/18/reference-server.html", "file": "reference-server.html", "label": "Server applications inventory", "anchor": "", "sha256": "e9f8bbcc8e3641fadd1d20991e8aad6b532155b786ba5a1b7b364ec4f1a5bef3"}], "sections": [], "synopsis": ["pg_checksums [ option ...] [[ -D | --pgdata ] datadir ]"], "signature": "pg_checksums [ option ...] [[ -D | --pgdata ] datadir ]", "description": ["pg_checksums \u2014 enable, disable or check data checksums in a PostgreSQL database cluster"], "environment": [{"name": "PGDATA", "description": "Specifies the directory where the database cluster is stored; can be overridden using the -D option."}, {"name": "PG_COLOR", "description": "Specifies whether to use color in diagnostic messages. Possible values are always , auto and never ."}], "manual_html": "<div><div class=\"refentry\" id=\"APP-PGCHECKSUMS\">\n<div class=\"titlepage\"></div>\n<div class=\"refnamediv\">\n<h2><span class=\"refentrytitle\"><span class=\"application\">pg_checksums</span></span></h2>\n<p>pg_checksums \u2014 enable, disable or check data checksums in a <span class=\"productname\">PostgreSQL</span> database cluster</p>\n</div>\n<div class=\"refsynopsisdiv\">\n<h2>Synopsis</h2>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.5.4.1\"><code class=\"command\">pg_checksums</code> [<em class=\"replaceable\"><code>option</code></em>...] [[ <code class=\"option\">-D</code> | <code class=\"option\">--pgdata</code> ]<em class=\"replaceable\"><code>datadir</code></em>]</p>\n</div>\n</div>\n<div class=\"refsect1\" id=\"R1-APP-PGCHECKSUMS-1\">\n<h2>Description</h2>\n<p><span class=\"application\">pg_checksums</span> checks, enables or disables data checksums in a <span class=\"productname\">PostgreSQL</span> cluster. The server must be shut down cleanly before running <span class=\"application\">pg_checksums</span>. 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.</p>\n<p>When 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 <code class=\"filename\">pg_control</code>.</p>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.5.6\">\n<h2>Options</h2>\n<p>The following command-line options are available:</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-D <em class=\"replaceable\"><code>directory</code></em></code><br></span><span class=\"term\"><code class=\"option\">--pgdata=<em class=\"replaceable\"><code>directory</code></em></code></span></dt>\n<dd>\n<p>Specifies the directory where the database cluster is stored.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-c</code><br></span><span class=\"term\"><code class=\"option\">--check</code></span></dt>\n<dd>\n<p>Checks checksums. This is the default mode if nothing else is specified.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-d</code><br></span><span class=\"term\"><code class=\"option\">--disable</code></span></dt>\n<dd>\n<p>Disables checksums.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-e</code><br></span><span class=\"term\"><code class=\"option\">--enable</code></span></dt>\n<dd>\n<p>Enables checksums.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-f <em class=\"replaceable\"><code>filenode</code></em></code><br></span><span class=\"term\"><code class=\"option\">--filenode=<em class=\"replaceable\"><code>filenode</code></em></code></span></dt>\n<dd>\n<p>Only validate checksums in the relation with filenode <em class=\"replaceable\"><code>filenode</code></em>.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-N</code><br></span><span class=\"term\"><code class=\"option\">--no-sync</code></span></dt>\n<dd>\n<p>By default, <code class=\"command\">pg_checksums</code> will wait for all files to be written safely to disk. This option causes <code class=\"command\">pg_checksums</code> 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 <code class=\"literal\">--check</code>.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-P</code><br></span><span class=\"term\"><code class=\"option\">--progress</code></span></dt>\n<dd>\n<p>Enable progress reporting. Turning this on will deliver a progress report while checking or enabling checksums.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--sync-method=<em class=\"replaceable\"><code>method</code></em></code></span></dt>\n<dd>\n<p>When set to <code class=\"literal\">fsync</code>, which is the default, <code class=\"command\">pg_checksums</code> 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.</p>\n<p>On Linux, <code class=\"literal\">syncfs</code> 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 <a class=\"xref\" href=\"/docs/18/runtime-config-error-handling.html#GUC-RECOVERY-INIT-SYNC-METHOD\">recovery_init_sync_method</a> for information about the caveats to be aware of when using <code class=\"literal\">syncfs</code>.</p>\n<p>This option has no effect when <code class=\"option\">--no-sync</code> is used.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-v</code><br></span><span class=\"term\"><code class=\"option\">--verbose</code></span></dt>\n<dd>\n<p>Enable verbose output. Lists all checked files.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-V</code><br></span><span class=\"term\"><code class=\"option\">--version</code></span></dt>\n<dd>\n<p>Print the <span class=\"application\">pg_checksums</span> version and exit.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-?</code><br></span><span class=\"term\"><code class=\"option\">--help</code></span></dt>\n<dd>\n<p>Show help about <span class=\"application\">pg_checksums</span> command line arguments, and exit.</p>\n</dd>\n</dl>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.5.7\">\n<h2>Environment</h2>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"envar\">PGDATA</code></span></dt>\n<dd>\n<p>Specifies the directory where the database cluster is stored; can be overridden using the <code class=\"option\">-D</code> option.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"envar\">PG_COLOR</code></span></dt>\n<dd>\n<p>Specifies whether to use color in diagnostic messages. Possible values are <code class=\"literal\">always</code>, <code class=\"literal\">auto</code> and <code class=\"literal\">never</code>.</p>\n</dd>\n</dl>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.5.8\">\n<h2>Notes</h2>\n<p>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.</p>\n<p>When using a replication setup with tools which perform direct copies of relation file blocks (for example <a class=\"xref\" href=\"/docs/18/app-pgrewind.html\" title=\"pg_rewind\"><span class=\"refentrytitle\"><span class=\"application\">pg_rewind</span></span></a>), 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.</p>\n<p>If <span class=\"application\">pg_checksums</span> is aborted or killed while enabling or disabling checksums, the cluster's data checksum configuration remains unchanged, and <span class=\"application\">pg_checksums</span> can be re-run to perform the same operation.</p>\n</div>\n</div></div>", "manual_path": "app-pgchecksums.html", "comparison_data": {"options": [{"names": ["-D directory", "--pgdata= directory"], "signature": "-D directory --pgdata= directory", "description": "Specifies the directory where the database cluster is stored."}, {"names": ["-c", "--check"], "signature": "-c --check", "description": "Checks checksums. This is the default mode if nothing else is specified."}, {"names": ["-d", "--disable"], "signature": "-d --disable", "description": "Disables checksums."}, {"names": ["-e", "--enable"], "signature": "-e --enable", "description": "Enables checksums."}, {"names": ["-f filenode", "--filenode= filenode"], "signature": "-f filenode --filenode= filenode", "description": "Only validate checksums in the relation with filenode filenode ."}, {"names": ["-N", "--no-sync"], "signature": "-N --no-sync", "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": ["-P", "--progress"], "signature": "-P --progress", "description": "Enable progress reporting. Turning this on will deliver a progress report while checking or enabling checksums."}, {"names": ["--sync-method= method"], "signature": "--sync-method= method", "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": ["-v", "--verbose"], "signature": "-v --verbose", "description": "Enable verbose output. Lists all checked files."}, {"names": ["-V", "--version"], "signature": "-V --version", "description": "Print the pg_checksums version and exit."}, {"names": ["-?", "--help"], "signature": "-? --help", "description": "Show help about pg_checksums command line arguments, and exit."}], "synopsis": ["pg_checksums [ option ...] [[ -D | --pgdata ] datadir ]"], "environment": [{"name": "PGDATA", "description": "Specifies the directory where the database cluster is stored; can be overridden using the -D option."}, {"name": "PG_COLOR", "description": "Specifies whether to use color in diagnostic messages. Possible values are always , auto and never ."}]}, "comparison_hash": "9df98d0a65050d461414d0c4fc42b1f97bbb808ec68690d4aad884d9b571bb05"}, "comparison": {"left": "11", "right": "12", "status": "added", "diff": "--- PostgreSQL 11\n+++ PostgreSQL 12\n@@ -1 +1,97 @@\n-Not recorded in this version\n+{\n+  \"environment\": [\n+    {\n+      \"description\": \"Specifies the directory where the database cluster is stored; can be overridden using the -D option.\",\n+      \"name\": \"PGDATA\"\n+    },\n+    {\n+      \"description\": \"Specifies whether to use color in diagnostic messages. Possible values are always , auto and never .\",\n+      \"name\": \"PG_COLOR\"\n+    }\n+  ],\n+  \"options\": [\n+    {\n+      \"description\": \"Specifies the directory where the database cluster is stored.\",\n+      \"names\": [\n+        \"-D directory\",\n+        \"--pgdata= directory\"\n+      ],\n+      \"signature\": \"-D directory --pgdata= directory\"\n+    },\n+    {\n+      \"description\": \"Checks checksums. This is the default mode if nothing else is specified.\",\n+      \"names\": [\n+        \"-c\",\n+        \"--check\"\n+      ],\n+      \"signature\": \"-c --check\"\n+    },\n+    {\n+      \"description\": \"Disables checksums.\",\n+      \"names\": [\n+        \"-d\",\n+        \"--disable\"\n+      ],\n+      \"signature\": \"-d --disable\"\n+    },\n+    {\n+      \"description\": \"Enables checksums.\",\n+      \"names\": [\n+        \"-e\",\n+        \"--enable\"\n+      ],\n+      \"signature\": \"-e --enable\"\n+    },\n+    {\n+      \"description\": \"Only validate checksums in the relation with filenode filenode .\",\n+      \"names\": [\n+        \"-f filenode\",\n+        \"--filenode= filenode\"\n+      ],\n+      \"signature\": \"-f filenode --filenode= filenode\"\n+    },\n+    {\n+      \"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 .\",\n+      \"names\": [\n+        \"-N\",\n+        \"--no-sync\"\n+      ],\n+      \"signature\": \"-N --no-sync\"\n+    },\n+    {\n+      \"description\": \"Enable progress reporting. Turning this on will deliver a progress report while checking or enabling checksums.\",\n+      \"names\": [\n+        \"-P\",\n+        \"--progress\"\n+      ],\n+      \"signature\": \"-P --progress\"\n+    },\n+    {\n+      \"description\": \"Enable verbose output. Lists all checked files.\",\n+      \"names\": [\n+        \"-v\",\n+        \"--verbose\"\n+      ],\n+      \"signature\": \"-v --verbose\"\n+    },\n+    {\n+      \"description\": \"Print the pg_checksums version and exit.\",\n+      \"names\": [\n+        \"-V\",\n+        \"--version\"\n+      ],\n+      \"signature\": \"-V --version\"\n+    },\n+    {\n+      \"description\": \"Show help about pg_checksums command line arguments, and exit.\",\n+      \"names\": [\n+        \"-?\",\n+        \"--help\"\n+      ],\n+      \"signature\": \"-? --help\"\n+    }\n+  ],\n+  \"synopsis\": [\n+    \"pg_checksums [ option ...] [[ -D | --pgdata ] datadir ]\"\n+  ]\n+}"}}