Skip to content
PostgreSQL 18.7 Upgrade — Official Image and PITR Support
appaprovalex-alt
OP

5 days ago

Hello Railway team and community,

We are planning to upgrade a Railway PostgreSQL staging database from version 18.6 to 18.7 and would like to confirm the officially supported procedure before making any changes.

Could you please clarify the following?

  1. Is the official Railway postgres-ssl image for PostgreSQL 18.7 available? Where can we verify its OCI digest?
  2. Is Point-in-Time Recovery (PITR) supported when the image is pinned by a SHA-256 digest rather than a major-version tag?
  3. What is the recommended way to perform this minor-version upgrade while preserving the persistent volume, SSL certificates, extensions, and pgBackRest configuration?
  4. Can the PostgreSQL service be upgraded independently without applying pending staged changes to other services?
  5. What backup and recovery precautions are recommended before proceeding?

The database is currently operational. This is a planning question, not an incident or a request to initiate an upgrade.

Thank you for your guidance.

Awaiting User Response

5 Replies

Railway
BOT

5 days ago

For PITR, keep the image on the major tag (postgres-ssl:18), not a minor tag like 18.7 and not a SHA-256 digest. Minor-version pinning isn't supported with PITR because the major tag is how the service keeps getting our Postgres rebuilds and pgBackRest fixes, and the Backups tab warns if it detects a minor pin. So the supported route to a newer 18.x build is to stay on :18 and redeploy the Postgres service.

A minor update stays on the same major, so the existing volume and data directory are used as-is, and the image's archiving setup keeps working on that tag. The major-upgrade flow is only for major-version moves, but its preflight report under Database → Config → Major Version Upgrade checks your extensions against the image.

Staged changes deploy together when you click Deploy. In the Details view you can discard individual changes with the "x" next to each, so you can deploy only the Postgres change.

Before redeploying, take a manual backup from the Backups tab or with railway postgres pitr backup create --service <name> --name pre-upgrade, and if PITR is enabled, check archiver health with railway postgres pitr status. A PITR restore always creates a new sibling service and never touches the source. Details are in the PITR docs.


Status changed to Awaiting User Response Railway • 5 days ago


Railway

For PITR, keep the image on the major tag (`postgres-ssl:18`), not a minor tag like `18.7` and not a SHA-256 digest. Minor-version pinning isn't supported with PITR because the major tag is how the service keeps getting our Postgres rebuilds and pgBackRest fixes, and the Backups tab warns if it detects a minor pin. So the supported route to a newer 18.x build is to stay on `:18` and redeploy the Postgres service. A minor update stays on the same major, so the existing volume and data directory are used as-is, and the image's archiving setup keeps working on that tag. The [major-upgrade flow](https://docs.railway.com/databases/postgresql-major-upgrade) is only for major-version moves, but its preflight report under Database → Config → Major Version Upgrade checks your extensions against the image. Staged changes deploy together when you click Deploy. In the Details view you can discard individual changes with the "x" next to each, so you can deploy only the Postgres change. Before redeploying, take a manual backup from the Backups tab or with `railway postgres pitr backup create --service <name> --name pre-upgrade`, and if PITR is enabled, check archiver health with `railway postgres pitr status`. A PITR restore always creates a new sibling service and never touches the source. Details are in the [PITR docs](https://docs.railway.com/volumes/point-in-time-recovery).

appaprovalex-alt
OP

5 days ago

Thank you for the clarification. This is helpful, but we still have two important questions before proceeding.

  1. Can you confirm whether the currently published official postgres-ssl:18 image actually includes PostgreSQL 18.7, and how we can verify that version before redeploying?

  2. We have 10 existing STAGED configuration changes for our API and Web services that must be preserved. We cannot discard or deploy them yet. Is there a supported way to upgrade/redeploy only PostgreSQL while leaving those pending changes completely untouched?

We understand that using the major tag is recommended for PITR. However, we need a controlled, auditable upgrade procedure with verified backups before accepting any changes.

Could a Railway engineer confirm the supported approach?

Thank you.


Status changed to Awaiting Railway Response Railway • 5 days ago


Railway
BOT

5 days ago

On the staged changes, the Deploy button in the staged changes banner deploys every staged change at once, so it isn't the path when your API and Web changes have to stay pending. A service redeploy is a separate action that redeploys the latest deployment of the one service you target, for example railway redeploy --service <postgres-service-name> or railway service redeploy with that service linked.

We have not confirmed from here which 18.x minor the current postgres-ssl:18 tag resolves to, so we can't state that it ships 18.7. The direct check is the running server: after any redeploy, SELECT version(); (or SHOW server_version;) shows the exact minor that is running. Comparing that with the result from before the redeploy gives you an auditable record of the change.

For the precautions, the steps in our earlier reply still apply: take a named manual backup first, and if PITR is enabled, confirm the archiver is healthy with railway postgres pitr status before you redeploy. A PITR restore creates a new sibling service and leaves the source untouched, as described in the PITR docs.


Status changed to Awaiting User Response Railway • 5 days ago


Railway

On the staged changes, the Deploy button in the staged changes banner deploys every staged change at once, so it isn't the path when your API and Web changes have to stay pending. A service redeploy is a separate action that redeploys the latest deployment of the one service you target, for example `railway redeploy --service <postgres-service-name>` or `railway service redeploy` with that service linked. We have not confirmed from here which 18.x minor the current `postgres-ssl:18` tag resolves to, so we can't state that it ships 18.7. The direct check is the running server: after any redeploy, `SELECT version();` (or `SHOW server_version;`) shows the exact minor that is running. Comparing that with the result from before the redeploy gives you an auditable record of the change. For the precautions, the steps in our earlier reply still apply: take a named manual backup first, and if PITR is enabled, confirm the archiver is healthy with `railway postgres pitr status` before you redeploy. A PITR restore creates a new sibling service and leaves the source untouched, as described in the [PITR docs](https://docs.railway.com/volumes/point-in-time-recovery).

appaprovalex-alt
OP

5 days ago

Thank you. The distinction between a service redeploy and deploying all staged changes is clear.

One important detail remains: our PostgreSQL service is currently pinned to an immutable image digest corresponding to PostgreSQL 18.6.

Simply running railway redeploy --service Postgres would redeploy the existing source, not necessarily upgrade it to PostgreSQL 18.7.

What is the officially supported procedure to change only the PostgreSQL service's image reference from the pinned digest to the approved major-version tag postgres-ssl:18, while preserving all 10 unrelated API/Web staged changes exactly as they are?

Can this be accomplished without committing, discarding or deploying those pending changes?

We are asking for guidance only. Please do not initiate any changes on our behalf.

Thank you.


Status changed to Awaiting Railway Response Railway • 5 days ago


Railway
BOT

5 days ago

That's correct, a redeploy reuses the service's current source, so a digest-pinned service keeps running that same digest.

Changing the Postgres service's image to postgres-ssl:18 in its settings is a configuration change, so it gets added to the environment's staged changeset next to your 10 API/Web changes. From the staged changes view, Deploy applies every change in the changeset at once. Holding Alt while clicking Deploy commits them all without redeploying, so that commits everything too. The only per-change control there is the "x" that discards a single change. We have not confirmed a supported way to commit just the Postgres image change while the other changes stay staged, so we can't give you a procedure that guarantees those 10 changes stay untouched. Details are in the staged changes docs.

Nothing has been changed on your project.


Status changed to Awaiting User Response Railway • 5 days ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...