Skip to content

Conversation

@sparafucile
Copy link

Adding "/18" to postgresql path as required for version 18

Adding "/18" to postgresql path as required for version 18
@SimmerV
Copy link
Collaborator

SimmerV commented Dec 5, 2025

I think this isn't needed, but rather to just drop the /data

@SimmerV
Copy link
Collaborator

SimmerV commented Dec 17, 2025

@sparafucile you're right that the volume path needs to be updated for Postgres 18 and beyond, however based on git pull 1259 from postgres and looking at the Postgres docs and Docker info here , the actual official PGDATA path is /var/lib/postgresql/18/docker

Concretely, this changes PGDATA to /var/lib/postgresql/MAJOR/docker, which matches the pre-existing convention/standard of the pg_ctlcluster/postgresql-common set of commands, and frankly is what we should've done to begin with, in a classic case of Chesterton's Fence.

This also changes the VOLUME to /var/lib/postgresql, which should be more reasonable, and make the docker-library/postgres#37 more obvious.

So our volume mount would be:

- ./postgres/data:/var/lib/postgresql

PostgreSQL 18 introduced this breaking change to enable faster major version upgrades. The new directory structure allows multiple PostgreSQL versions to coexist in the same volume, making pg_upgrade --link possible for near-instantaneous upgrades between major versions.

@SimmerV SimmerV requested a review from daviesgeek December 17, 2025 22:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants