Skip to content

Conversation

@s01ipsist
Copy link

@s01ipsist s01ipsist commented Nov 7, 2025

Adds support for Postgres 18 by adding conditional logic to set the data volume path differently for before/after v 18, as guided by https://hub.docker.com/_/postgres

The defined VOLUME was changed in 18 and above to /var/lib/postgresql. Mounts and volumes should be targeted at the updated location

Important Note: (for PostgreSQL 17 and below) Mount the data volume at /var/lib/postgresql/data and not at /var/lib/postgresql because mounts at the latter path WILL NOT PERSIST database data when the container is re-created

Fixes #364
Replaces #358 / #367

Not sure if this needs to be fixed or not, but there's a subtle functional change in the result with this code as is.

PostgreSQL Database directory appears to contain a database; Skipping initialization

v18 triggers the path with message output

PostgreSQL init process complete; ready for start up.

and stops the container.

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.

Volume Path changed for postgres v18+

1 participant