a month ago
Hello Railway team,
I use the postgres-ssl template with PITR enabled.
I need to rotate the PostgreSQL administrator (postgres) password using Database → Config → Regenerate Password.
Before proceeding, could you confirm:
- Does Regenerate Password update both the actual PostgreSQL role password and Railway-managed connection variables?
- Does PITR or WAL archiving depend on the PostgreSQL administrator password, and will password regeneration interrupt either service?
- Can I rotate this password safely without disabling or re-enabling PITR?
- PITR shows a restore size warning of approximately 22.3 GB, exceeding the plan's 5 GB maximum volume size. What backup or recovery checks should I perform before rotating the password?
The application already uses a separate limited-permission database role. I have not yet rotated the administrator password.
I would appreciate guidance on the safest supported procedure.
Thank you.
5 Replies
Status changed to Awaiting Railway Response Railway • about 1 month ago
a month ago
Regenerate Password changes the live postgres role password in the database and updates the service's password variable. Connection variables that reference it, like DATABASE_URL and PGPASSWORD, pick up the new value automatically. It also always redeploys the Postgres service so the container restarts with the new password, so expect a short restart. Anything using the postgres credentials outside variable references will need the new value.
PITR WAL archiving doesn't use the Postgres password. It authenticates to its archive bucket with its own separate credentials, which the rotation doesn't touch. You don't need to disable or re-enable PITR. The only interruption is the brief pause in archiving while the container restarts, and archiving resumes after startup. Disabling PITR on a standalone Postgres service would delete the WAL archive bucket, so leaving it enabled is the safer choice.
The restore size warning is about restores. A point-in-time restore creates a new Postgres service, and about 22.3 GB of data won't fit within your plan's 5 GB volume maximum. Rotating the password doesn't change that warning. Before rotating, confirm that your application's separate role doesn't depend on any postgres variables, and do the rotation at a time when a brief database restart is acceptable.
Status changed to Awaiting User Response Railway • about 1 month ago
Railway
Regenerate Password changes the live `postgres` role password in the database and updates the service's password variable. Connection variables that reference it, like `DATABASE_URL` and `PGPASSWORD`, pick up the new value automatically. It also always redeploys the Postgres service so the container restarts with the new password, so expect a short restart. Anything using the `postgres` credentials outside variable references will need the new value. PITR WAL archiving doesn't use the Postgres password. It authenticates to its archive bucket with its own separate credentials, which the rotation doesn't touch. You don't need to disable or re-enable PITR. The only interruption is the brief pause in archiving while the container restarts, and archiving resumes after startup. Disabling PITR on a standalone Postgres service would delete the WAL archive bucket, so leaving it enabled is the safer choice. The restore size warning is about restores. A point-in-time restore creates a new Postgres service, and about 22.3 GB of data won't fit within your plan's 5 GB volume maximum. Rotating the password doesn't change that warning. Before rotating, confirm that your application's separate role doesn't depend on any `postgres` variables, and do the rotation at a time when a brief database restart is acceptable.
a month ago
Thank you for the explanation.
Before rotating the password of our production PostgreSQL service, could a human Railway support engineer please confirm:
- Does Regenerate Password preserve the existing PITR WAL archive and restore points?
- Is there any risk of data loss or PITR disruption beyond the brief PostgreSQL restart?
- Given the 22.3 GB restore-size warning and our plan's 5 GB volume limit, is password rotation still safe without changing PITR settings?
This is a live production database, so we'd like explicit confirmation before proceeding.
Thank you.
Status changed to Awaiting Railway Response Railway • about 1 month ago
a month ago
This thread has been opened as a bounty so the community can help solve it.
Status changed to Open Railway • about 1 month ago
a month ago
- As mentioned above, PITR WAL does not rely on the database's password.
- No.
- As mentioned above, PITR does not rely on the database's password.
a month ago
Hello Railway Support,
We have completed a production PostgreSQL password rotation preflight and are ready to use the official Database → Config → Regenerate Password action.
Before proceeding, we need confirmation about one remaining production safety concern.
Our PostgreSQL service currently has these variables:
- POSTGRES_PASSWORD
- PGPASSWORD
- DATABASE_URL
All three credentials currently match, and password authentication works.
However, we cannot verify whether PGPASSWORD and DATABASE_URL are reference-based or hardcoded. We are concerned that password regeneration could update only POSTGRES_PASSWORD, leaving the other variables stale.
Could a Railway engineer please confirm:
- Will the official Regenerate Password action update all three variables in our current configuration?
- If PGPASSWORD or DATABASE_URL is hardcoded, what is the safest procedure before rotation?
- Can Railway verify the reference configuration without exposing credentials?
- Will our separate application database role
payment_appremain unaffected?
This is a live production database. We have not regenerated the password or changed any variables.
Please confirm the safest next step before we proceed.
Thank you.
a month ago
The variables you mentioned are composed of references.
4 - I’d redeploy that service after regenerating your Postgres credentials.