1 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>28.2. Data Checksums</title><link rel="stylesheet" type="text/css" href="stylesheet.css" /><link rev="made" href="pgsql-docs@lists.postgresql.org" /><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><link rel="prev" href="wal-reliability.html" title="28.1. Reliability" /><link rel="next" href="wal-intro.html" title="28.3. Write-Ahead Logging (WAL)" /></head><body id="docContent" class="container-fluid col-10"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="5" align="center">28.2. Data Checksums</th></tr><tr><td width="10%" align="left"><a accesskey="p" href="wal-reliability.html" title="28.1. Reliability">Prev</a> </td><td width="10%" align="left"><a accesskey="u" href="wal.html" title="Chapter 28. Reliability and the Write-Ahead Log">Up</a></td><th width="60%" align="center">Chapter 28. Reliability and the Write-Ahead Log</th><td width="10%" align="right"><a accesskey="h" href="index.html" title="PostgreSQL 18.0 Documentation">Home</a></td><td width="10%" align="right"> <a accesskey="n" href="wal-intro.html" title="28.3. Write-Ahead Logging (WAL)">Next</a></td></tr></table><hr /></div><div class="sect1" id="CHECKSUMS"><div class="titlepage"><div><div><h2 class="title" style="clear: both">28.2. Data Checksums <a href="#CHECKSUMS" class="id_link">#</a></h2></div></div></div><div class="toc"><dl class="toc"><dt><span class="sect2"><a href="checksums.html#CHECKSUMS-OFFLINE-ENABLE-DISABLE">28.2.1. Off-line Enabling of Checksums</a></span></dt></dl></div><a id="id-1.6.15.4.2" class="indexterm"></a><p>
3 By default, data pages are protected by checksums, but this can
4 optionally be disabled for a cluster. When enabled, each data page includes
5 a checksum that is updated when the page is written and verified each time
6 the page is read. Only data pages are protected by checksums; internal data
7 structures and temporary files are not.
9 Checksums can be disabled when the cluster is initialized using <a class="link" href="app-initdb.html#APP-INITDB-DATA-CHECKSUMS"><span class="application">initdb</span></a>.
10 They can also be enabled or disabled at a later time as an offline
11 operation. Data checksums are enabled or disabled at the full cluster
12 level, and cannot be specified individually for databases or tables.
14 The current state of checksums in the cluster can be verified by viewing the
15 value of the read-only configuration variable <a class="xref" href="runtime-config-preset.html#GUC-DATA-CHECKSUMS">data_checksums</a> by issuing the command <code class="command">SHOW
16 data_checksums</code>.
18 When attempting to recover from page corruptions, it may be necessary to
19 bypass the checksum protection. To do this, temporarily set the
20 configuration parameter <a class="xref" href="runtime-config-developer.html#GUC-IGNORE-CHECKSUM-FAILURE">ignore_checksum_failure</a>.
21 </p><div class="sect2" id="CHECKSUMS-OFFLINE-ENABLE-DISABLE"><div class="titlepage"><div><div><h3 class="title">28.2.1. Off-line Enabling of Checksums <a href="#CHECKSUMS-OFFLINE-ENABLE-DISABLE" class="id_link">#</a></h3></div></div></div><p>
22 The <a class="link" href="app-pgchecksums.html" title="pg_checksums"><span class="application">pg_checksums</span></a>
23 application can be used to enable or disable data checksums, as well as
24 verify checksums, on an offline cluster.
25 </p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="wal-reliability.html" title="28.1. Reliability">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="wal.html" title="Chapter 28. Reliability and the Write-Ahead Log">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="wal-intro.html" title="28.3. Write-Ahead Logging (WAL)">Next</a></td></tr><tr><td width="40%" align="left" valign="top">28.1. Reliability </td><td width="20%" align="center"><a accesskey="h" href="index.html" title="PostgreSQL 18.0 Documentation">Home</a></td><td width="40%" align="right" valign="top"> 28.3. Write-Ahead Logging (<acronym class="acronym">WAL</acronym>)</td></tr></table></div></body></html>