From 0965f7fca5f0b46c3750d095414c260c4ba25d13 Mon Sep 17 00:00:00 2001 From: Ned Twigg Date: Thu, 24 Sep 2026 20:23:17 -0700 Subject: [PATCH] Run local and test services on PostgreSQL 18.6 Neon runs 18.6 in production and previews, so the tests now run on the same major version. The 18 image stores data under /var/lib/postgresql/18/docker and refuses a volume that holds a 17 cluster, so the volume is renamed and an existing checkout starts a fresh development database. Full suite (175 tests), db:verify and packages:verify pass on 18.6. Co-Authored-By: Claude Sonnet 5 --- README.md | 2 ++ compose.yaml | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index a86574c..c787936 100644 --- a/README.md +++ b/README.md @@ -112,6 +112,8 @@ Persistent development/production databases record applied-file checksums. Editi `DATABASE_URL` directs status/validate/migrate at an explicitly supplied persistent database. Otherwise they use `pgstencil_dev`. Schema/type commands always use a disposable migrated clone. Never point template management at a production cluster. +Local services run PostgreSQL 18. The 18 image keeps its data under `/var/lib/postgresql/18/docker` and refuses a volume holding a 17 cluster, so the volume is named `postgres-18-data` and an existing checkout starts a fresh development database. The old volume stays until removed with `docker volume rm _postgres-data`; `docker volume ls` lists it. + ## Resource lifecycle Each checkout has a Compose project name derived from its absolute path, its own network, and a named Postgres volume. Local credentials and resolved ports are cached in ignored `.pgstencil/services.json`. Both exposed service ports bind to loopback. Change image versions in `compose.yaml`, then stop and restart the services; do not change Postgres major versions against an existing volume without a database upgrade. diff --git a/compose.yaml b/compose.yaml index c5fef9d..a680aeb 100644 --- a/compose.yaml +++ b/compose.yaml @@ -1,12 +1,12 @@ services: postgres: - image: postgres:17.11-alpine + image: postgres:18.6-alpine environment: POSTGRES_USER: pgstencil POSTGRES_PASSWORD: pgstencil-local-only POSTGRES_DB: postgres command: [postgres, -c, max_connections=200] - volumes: [postgres-data:/var/lib/postgresql/data] + volumes: [postgres-18-data:/var/lib/postgresql] ports: ['127.0.0.1::5432'] healthcheck: test: [CMD-SHELL, 'pg_isready -U pgstencil -d postgres'] @@ -27,4 +27,4 @@ services: condition: service_healthy ports: ['127.0.0.1::5000'] volumes: - postgres-data: + postgres-18-data: