Problem to solve
#194 bumps databases/postgre from postgres:16 to postgres:18 and fails CI:
smoke: since 18 the official image keeps data in /var/lib/postgresql/18/docker and refuses to start when anything is mounted at /var/lib/postgresql/data (our compose mount);
db-upgrade-tests (postgres): a PostgreSQL 16 data directory cannot be opened by 18 without pg_upgrade or dump/restore, so existing postgres-data volumes would break.
Impact
Medium
Proposed solution
- Move to the 18+ layout:
postgres:18, a single mount at /var/lib/postgresql, a new compose volume (postgres18-data) so the old 16 volume is left untouched.
- Add
databases/postgre/upgrade-major.sh: pg_dumpall from the old volume with the old image, then restore into the new volume with the new image. The source volume is read only, so the operation can be rolled back.
- The db-upgrade harness runs this script when the PostgreSQL major changes, so CI proves the documented migration keeps data. The 16 → 17 self-test (same volume, must fail) is unchanged.
- Document the procedure (
databases/postgre/README.md, RUNBOOK).
Constraints or notes
Assumption: PostgreSQL only runs through Docker Compose (local and CI); the repository has no Kubernetes/ArgoCD manifests for it. A deployed instance elsewhere would need its own procedure.
Problem to solve
#194 bumps
databases/postgrefrompostgres:16topostgres:18and fails CI:smoke: since 18 the official image keeps data in/var/lib/postgresql/18/dockerand refuses to start when anything is mounted at/var/lib/postgresql/data(our compose mount);db-upgrade-tests(postgres): a PostgreSQL 16 data directory cannot be opened by 18 withoutpg_upgradeor dump/restore, so existingpostgres-datavolumes would break.Impact
Medium
Proposed solution
postgres:18, a single mount at/var/lib/postgresql, a new compose volume (postgres18-data) so the old 16 volume is left untouched.databases/postgre/upgrade-major.sh:pg_dumpallfrom the old volume with the old image, then restore into the new volume with the new image. The source volume is read only, so the operation can be rolled back.databases/postgre/README.md, RUNBOOK).Constraints or notes
Assumption: PostgreSQL only runs through Docker Compose (local and CI); the repository has no Kubernetes/ArgoCD manifests for it. A deployed instance elsewhere would need its own procedure.