I have found when running Postgres 18+ in Docker the PGDATA directory has changed to include a major version in it. For example when I cd examples/demo and run docker compose up now, Postgres 18 has its volume and PGDATA configured with /var/lib/postgresql/data which produces the following error when starting up:
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
When I change it to /var/lib/postgresql then docker compose up works as expected.
--- a/examples/demo/docker-compose.yml
+++ b/examples/demo/docker-compose.yml
@@ -6,7 +6,7 @@ services:
ports:
- 6000:5432
volumes:
- - shard_0:/var/lib/postgresql/data
+ - shard_0:/var/lib/postgresql
Is the example at examples/demo supported? Do you want a small PR with the above change in each spot?
Thanks.
I have found when running Postgres 18+ in Docker the PGDATA directory has changed to include a major version in it. For example when I
cd examples/demoand rundocker compose upnow, Postgres 18 has its volume and PGDATA configured with/var/lib/postgresql/datawhich produces the following error when starting up:When I change it to
/var/lib/postgresqlthendocker compose upworks as expected.Is the example at
examples/demosupported? Do you want a small PR with the above change in each spot?Thanks.