Michael Paquier - PostgreSQL committer

  • Home
  • Manuals
  • Presentations
  • Projects
  • Resume
  • Tags
  • About

Postgres 9.4 feature highlight - data checksum switch as a GUC parameter

You liked this post or you have a comment? Contact information is available here and sponsoring is here.
23 Sep 2013
Tags: 9.4, postgres, postgresql, checksum, guc

Postgres 9.3 has introduced data checksums at the data page level, using a CRC-16 algorithm for the checksum calculation.

With 9.3, the only way to check if an existing server has checksums enabled was to have a look at the data folder using pg_controldata like that…

$ pg_controldata $PGDATA | grep checksum
Data page checksum version: 0/1

0 indicates that checksums are disabled, and 1 the opposite. By the way, this is particularly unhandy in the case of a server whose file system cannot be accessed directly.

However, a new GUC parameter has been added in Postgres 9.4 reporting if checksums are enabled on a server, making the user life easier. This allows to check the presence of checksums on a cluster by using normal client applications like psql with a simple SHOW command or by having a look at pg_settings.

=# SHOW data_checksums;
 data_checksums
----------------
 off
(1 row)
=# SELECT name, setting, category FROM pg_settings WHERE name = 'data_checksums';
      name      | setting |    category
----------------+---------+----------------
 data_checksums |   off   | Preset Options
(1 row)

Note this parameter is read-only as checksums can only be set at initdb, and that it is not mentioned in postgresql.conf.

Search

Social

Github

RSS Feeds

Main

Postgres

Sponsor

Unless otherwise specified, the contents of this website are (C)Copyright Michael Paquier 2010-2025 and are licensed for use under CC BY-NC-ND 4.0.