-
Notifications
You must be signed in to change notification settings - Fork 110
Description
If you really need a Postgres 18 instance, take a look at my template https://railway.com/deploy/postgresql-18. Please note that some features won't work, such as the data tab.
I was working on adding support for Postgres 18 but they've changed quite a few things regarding volume mount paths:
-
They now recommend using a major version in the mount path, e.g.,
/var/lib/postgresql/18/docker. I would recommend using the new path, though I understand it might cause issues with previous versions and possibly with Railway's underlying architecture. Using the new path offers the benefit of easier upgrades according to their documentation. -
They've also changed the mount path to
/var/lib/postgresqlinstead of/var/lib/postgresql/data. Not implementing this change results in issues:
/orchestrator.RouterLegacyService/StartDeployment UNKNOWN: crun: openat2 `var/lib/postgresql/data`: No such file or directory: OCI runtime attempted to invoke a command that was not found
I believe the Postgres 18 entrypoint or another dependency requires the volume to be mounted at /var/lib/postgresql. That will require the init scripts to support that new volume mount path and also Railway to change that.
My question is: should I implement both recommended changes (major version in path and new mount path) and have Railway adapt their approach, or should I implement only the new mount path, which appears to be the minimum requirement?
context:
- https://hub.docker.com/_/postgres#pgdata (docs)
- Change
PGDATAin 18+ to/var/lib/postgresql/MAJOR/dockerdocker-library/postgres#1259 (reason on why) - https://railway.com/project/636f1c4f-8c17-4afe-92cd-6c18b7f24dbf/service/12936ca6-83a4-4924-ab9a-f94ebb5177a9?environmentId=e7bcbd4b-2172-4230-aa21-c5a81d1fe264&id=72445d45-6187-480f-9c24-8558b1af26ae#build (errors on deploying it, feel free to do whatever on that service/project)
- add postgres 18 #31 (my PR, implements the new min mount path only)