docker-spotweb icon indicating copy to clipboard operation
docker-spotweb copied to clipboard

Postgres 18

Open mrmuiz opened this issue 2 months ago • 1 comments

For the new Postgres 18:

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

Become : volumes: - postgres-data:/var/lib/postgresql

mrmuiz avatar Oct 07 '25 13:10 mrmuiz

Indeed, I do NOT recommend doing a docker compose pull if anybody currently runs a previous version of postgres 😅

Now getting this:

Error: in 18+, these Docker images are configured to store database data in a
       format which is compatible with "pg_ctlcluster" (specifically, using
       major-version-specific directory names).  This better reflects how
       PostgreSQL itself works, and how upgrades are to be performed.

       See also [https://github.com/docker-library/postgres/pull/1259⁠](https://github.com/docker-library/postgres/pull/1259)

       Counter to that, there appears to be PostgreSQL data in:
         /var/lib/postgresql

       This is usually the result of upgrading the Docker image without upgrading
       the underlying database using "pg_upgrade" (which requires both versions).

       See [https://github.com/docker-library/postgres/issues/37⁠](https://github.com/docker-library/postgres/issues/37) for a (long)
       discussion around this process, and suggestions for how to do so.

I reverted back to version 17, and it started working again.

  postgres:
    image: postgres:17

I do not (currently) want to find out the correct steps to update it 🤡

KoalaBear84 avatar Oct 14 '25 12:10 KoalaBear84

I encountered the same problem with some other projects as well. Indeed going back to Postgres 17 resolves it, or you can correct the path and move forward with Postgres 18.

edv avatar Nov 17 '25 22:11 edv