From c94186132cf074d71ec9ae85185cd92a8fe1b345 Mon Sep 17 00:00:00 2001 From: notplants <@notplants> Date: Mon, 8 Jun 2026 20:45:44 +0000 Subject: [PATCH] fix: pin PGDATA so the postgres 18 bump upgrades in place postgres:18 (tracked by pgautoupgrade) relocated the default PGDATA from /var/lib/postgresql/data to /var/lib/postgresql/18/docker. Since the db volume is mounted at the legacy path, pg18 would init a fresh empty cluster there and orphan all existing data (pgautoupgrade never runs the upgrade). Pinning PGDATA to the legacy path makes pg18 find the existing cluster and upgrade it in place. --- compose.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/compose.yml b/compose.yml index d349333..09f782e 100644 --- a/compose.yml +++ b/compose.yml @@ -128,6 +128,10 @@ services: secrets: - db_password environment: + # postgres:18 relocated the default PGDATA to /var/lib/postgresql/18/docker. + # Pin it to the legacy path so pgautoupgrade finds the existing cluster on the + # mounted volume and upgrades it in place, instead of init'ing an empty one. + - PGDATA=/var/lib/postgresql/data - LC_COLLATE=C - LC_CTYPE=C - POSTGRES_DB=synapse