The Railway PostgreSQL database service allows you to provision and connect to a PostgreSQL database with zero configuration.
There are two ways to connect to a PostgreSQL database:
- Add a Reference Variable to a service
railway connectto start a
The following variables can be referenced in your services:
Note, Many libraries will automatically look for the
DATABASE_URL variable and use
it to connect to PostgreSQL but you can use these variables in whatever way works for you.
The Postgres database service uses the timescale/timescaledb-postgis:latest-pg13 docker image.
Timescale and PostGIS
All PostgreSQL containers have the PostGIS and Timescale family of extensions installed. This means you can do both geo-spatial and time-series queries out of the box with Railway!
You must enable the extensions in every database you want to use them. For example,
Edit this file on GitHub