FATAL: database files are incompatible with server — The data directory was initialized by PostgreSQL version 15, which is not compatible with this version 16
A newer (or older) PostgreSQL major version was started on an existing data directory.
database files are incompatible with serverwas initialized by PostgreSQL version Meaning
Major versions have different on-disk formats. Bumping the Docker image tag (postgres:15 → postgres:16) on an existing volume triggers this.
Common causes
- Docker image tag upgraded on the same volume
- OS package upgrade without pg_upgrade
⚡ Quick fix
- Go back to the original version to start the server
- Upgrade with pg_upgrade or dump/restore into the new version
- Pin major versions in Docker tags
Detailed fix by platform
Docker
docker run --rm -v pgdata:/var/lib/postgresql/data postgres:15 pg_dumpall …then restore into a postgres:16 volume
How to diagnose
- Versions — Data dir version vs server version
- Recent change — Did it start after a deploy, upgrade, or configuration change? Compare with the last working version.
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
Most viewed in PostgreSQL
Other ways to find it
Where this error sits
Origin: Data. Errors that are often confused with or caused by this one (click to open):
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 13 Oct 2026