- Symptom
- FATAL: database files are incompatible with serverDETAIL: The data directory was initialized by PostgreSQL version 17, which is not compatible with this version 18.0.
- Cause
- The latest tag and other tags without a major version move to each new major release, and a data directory from one major version cannot be opened by the next without pg_upgrade or a dump and restore.
- Fix
- Pin the major version tag for any persistent volume and upgrade on purpose with pg_upgrade or pg_dumpall.
- Apply
services: db: image: postgres:17 # pin the major, never latest with a persistent volume- Affected
- Any major bump of the Docker Official Image, most recently 17 to 18 in September 2025
- Sources
Last verified 2026-10-15 · Confirmed by 0 builders