Skip to content

Conversation

@DejavuMoe
Copy link

The Docker Compose template example provided in the documentation needs to be corrected regarding the database mount volume mapping; otherwise, first-time users may encounter a situation where the database is not persistent, resulting in complete data loss after the Docker container stops or is manually restarted.

Copy link
Member

@fguillot fguillot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, the Postgres image version should be bumped to 18. It was missed in this commit: 832c868. The intend was to update the example with Postgres 18 and use the new volume path /var/lib/postgresql/data -> /var/lib/postgresql.

See https://hub.docker.com/_/postgres#pgdata

Important Change: the PGDATA environment variable of the image was changed to be version specific in PostgreSQL 18 and above. For 18 it is /var/lib/postgresql/18/docker. Later versions will replace 18 with their respective major version (e.g., /var/lib/postgresql/19/docker for PostgreSQL 19.x). The defined VOLUME was changed in 18 and above to /var/lib/postgresql. Mounts and volumes should be targeted at the updated location. This will allow users upgrading between PostgreSQL major releases to use the faster --link when running pg_upgrade and mounting /var/lib/postgresql.

@DejavuMoe
Copy link
Author

Thanks for the review!
The problem likely lies in the packaging of the Docker image upstream of Postgres. Therefore, this Pr change is unnecessary, and maintaining the status quo is the best course of action.

@DejavuMoe DejavuMoe closed this Dec 17, 2025
@DejavuMoe DejavuMoe deleted the patch-1 branch December 17, 2025 08:14
@fguillot
Copy link
Member

I added some notes in this commit hoping to avoid confusion 1db2cb7

@DejavuMoe
Copy link
Author

I added some notes in this commit hoping to avoid confusion 1db2cb7

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants