Skip to content

Commit e217e11

Browse files
Postgres 18 Changelog (#56)
* Mount postgres volumes at /var/lib/postgresql This is to resolve errors like the following, now that postgres:latest resolves to the v18 image by default. ```quote 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 docker-library/postgres#1259 Counter to that, there appears to be PostgreSQL data in: /var/lib/postgresql/data (unused mount/volume) This is usually the result of upgrading the Docker image without upgrading the underlying database using "pg_upgrade" (which requires both versions). The suggested container configuration for 18+ is to place a single mount at /var/lib/postgresql which will then place PostgreSQL data in a subdirectory, allowing usage of "pg_upgrade --link" without mount point boundary issues. See docker-library/postgres#37 for a (long) discussion around this process, and suggestions for how to do so. ``` * Limit version to Postgres 18. Add Changelog entry. --------- Co-authored-by: Matt Gallagher <mjg1992@hotmail.co.uk>
1 parent 797d67f commit e217e11

File tree

3 files changed

+31
-3
lines changed

3 files changed

+31
-3
lines changed

CHANGELOG.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,29 @@
11
# PowerSync Self Hosted Example
22

3+
## 2025-11-25
4+
5+
### Postgres 18 Upgrade
6+
7+
Updated Postgres demos for Postgres 18 compatibility. Postgres 18 contains breaking changes for Docker volume mount points. First time demo runners should be able to start the demo using the standard `docker compose up` commands.
8+
9+
Users with existing configurations should either:
10+
11+
#### Start from a clean slate
12+
13+
With the relevant demo directory as the current working directory, run:
14+
15+
```bash
16+
# Clear previous data (this deletes Docker volumes)
17+
docker compose down --volumes
18+
19+
# Run the demo
20+
docker compose up
21+
```
22+
23+
#### Migrate existing data
24+
25+
See https://github.com/docker-library/postgres/issues/37 for options.
26+
327
## 2025-05-13
428

529
- Updated YAML config files to use published schema

demos/nodejs-postgres-bucket-storage/docker-compose.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ services:
2727
- ../nodejs/init-scripts:/docker-entrypoint-initdb.d
2828

2929
pg-storage:
30-
image: postgres:latest
30+
image: postgres:18
3131
restart: always
3232
environment:
3333
- POSTGRES_USER=${PG_STORAGE_DATABASE_USER}
@@ -39,7 +39,11 @@ services:
3939
ports:
4040
- "${PG_STORAGE_DATABASE_PORT}:${PG_STORAGE_DATABASE_PORT}"
4141
healthcheck:
42-
test: ["CMD-SHELL", "pg_isready -U ${PG_STORAGE_DATABASE_USER} -d ${PG_STORAGE_DATABASE_NAME}"]
42+
test:
43+
[
44+
"CMD-SHELL",
45+
"pg_isready -U ${PG_STORAGE_DATABASE_USER} -d ${PG_STORAGE_DATABASE_NAME}",
46+
]
4347
interval: 5s
4448
timeout: 5s
4549
retries: 5

services/postgres.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
services:
22
pg-db:
3-
image: postgres:latest
3+
image: postgres:18
44
restart: always
55
environment:
66
- POSTGRES_USER=${PG_DATABASE_USER}

0 commit comments

Comments
 (0)