PostgreSQL · tool · fg-0275

pg_upgrade to PostgreSQL 18 stops with 'old cluster does not use data checksums but the new one does'

If you see old cluster does not use data checksums but the new one does, the cause and the fix for PostgreSQL are below, last verified 2026-10-15.

Verified Oct 2026trust 50/100
Symptom
old cluster does not use data checksums but the new one doespg_upgrade --check fails right after initdb of the new 18 cluster
Cause
initdb in PostgreSQL 18 enables data checksums by default, and pg_upgrade requires both clusters to match. Clusters created by earlier versions usually have checksums off.
Fix
Initialize the new cluster with --no-data-checksums and upgrade. If you want checksums, enable them afterwards with pg_checksums while the server is stopped.
Apply
initdb --no-data-checksums -D /var/lib/postgresql/18/data pg_upgrade -b /usr/lib/postgresql/17/bin -B /usr/lib/postgresql/18/bin \ -d /var/lib/postgresql/17/main -D /var/lib/postgresql/18/data --check
Affected
PostgreSQL 18.0 and later (September 2025), upgrading from clusters without checksums
Sources

Last verified 2026-10-15 · Confirmed by 0 builders

Related traps

Have your agent know this before it fails

$ /plugin marketplace add getfootgun/footgun
$ /plugin install footgun@footgun