pg_integrity_checksums 2.2.0

This Release
pg_integrity_checksums 2.2.0
Date
Status
Stable
Other Releases
Abstract
Multi-level data integrity checksums for PostgreSQL
Description
pg_integrity_checksums provides checksum functions for PostgreSQL at six granularity levels (page, cell, tuple, table, index and database), each in a physical and a logical variant (cell level is logical only). Physical checksums detect storage corruption and change after VACUUM FULL, CLUSTER or REINDEX. Logical checksums depend only on data content: they exclude relation OIDs, heap TIDs and type OIDs, canonicalize enum, numeric, array, composite and range values, are endian-independent, and do not require a primary key. Logical index checksums are derived from table data and the index definition, so they work for every access method. The implementation uses FNV-1a 32-bit for the legacy SQL API and adds generic FNV-1a 32/64-bit overloads, supports parallel scans through the pg_integrity_checksums.workers GUC, and transparently aggregates partitioned tables and partitioned indexes. pg_integrity_checksums.strict makes database scans fail instead of skipping relations without a usable checksum.
Released By
VictorNagibator
License
MIT
Resources
Special Files
Tags

Extensions

pg_integrity_checksums 2.2.0
Checksum functions at page, cell, tuple, table, index and database level

Documentation

CODE_OF_CONDUCT
Contributor Covenant Code of Conduct
architecture
Architecture
troubleshooting
Troubleshooting
CONTRIBUTING
Contributing
bug_report
bug_report
operations
Operations
requirements-docs
requirements-docs
testing
Testing and releases
pull_request_template
pull_request_template
SECURITY
Security Policy
README
pg_integrity_checksums CLI
feature_request
feature_request
functions
Functions and algorithms
MIGRATION
Migrating from pg_checksums 1.x
index
PostgreSQL integrity checks you can run online
installation
Installation
cli
pg_integrity_checksums CLI

README

pg_integrity_checksums - Multi-Level Data Integrity Extension for PostgreSQL

CI CodeQL Quality Docker image PostgreSQL 12-19 PGEXT.CLOUD License: MIT Docs XERJ Corpus Hub contributor

Overview

pg_integrity_checksums provides page, cell, tuple, table, index and database checksums. Page checksums are physical; cell checksums are logical; the other levels support both physical and logical modes.

Logical checksums are canonical across endianness, VACUUM/REINDEX/physical movement and database OIDs. Physical checksums are for on-disk corruption in one specific cluster.

The legacy SQL API uses FNV-1a 32-bit. Generic overloads add FNV-1a 64-bit and return raw bytea digests:

SELECT encode(pg_table_logical_checksum('public.orders'::regclass, 'fnv64'), 'hex');
SELECT pg_checksum_bigint(pg_table_logical_checksum('public.orders'::regclass, 'fnv64'));

Page checksums remain PostgreSQL’s built-in 32-bit page checksum.

Quick start

CREATE EXTENSION pg_integrity_checksums;
SELECT pg_table_logical_checksum('public.orders'::regclass);

Install from packages, Docker, PGXN or build with PGXS:

git clone https://github.com/VictorNagibator/pg_integrity_checksums.git
cd pg_integrity_checksums
make
sudo make install

The CLI lives in cli/:

cd cli
go build ./cmd/pg_integrity_checksums
pg_integrity_checksums capture --db "$DATABASE_URL" --output baseline.json
pg_integrity_checksums verify --db "$DATABASE_URL" --baseline baseline.json

Add --hash fnv64 to capture for a v2 baseline with 64-bit digests.

Documentation

Support