19 days ago
I am trying to restore my fairly large postgres DB as
pg_restore -h {url} -p {port} -U postgres -d {db} --no-owner --no-privileges --disable-triggers -j 1 db.dump
using deployed docker container (need some custom stuff for postgres)
It seems like it is hitting RAM limit on the instance, just by looking at metrics.
attached volume is fine
error i get is
db_user pg_restore: error: could not execute query: ERROR: could not resize shared memory segment "/PostgreSQL.3405242480" to 16777216 bytes: No space left on device Command was: REFRESH MATERIALIZED VIEW public.rag_study_keys;
Any suggestions, how to move my DB?
Attachments
2 Replies
19 days ago
Hey! The error you're seeing is a shared memory (SHM) limit issue, not a disk space issue. Railway defaults to 64MB of SHM, which isn't enough for heavy operations like refreshing materialized views during a restore.
To fix this, add the `RAILWAY_SHM_SIZE_BYTES` environment variable to your Postgres service and set it to something like `524288000` (500MB). If that's still not enough, you can bump it higher (e.g. `1073741824` for 1GB). Redeploy after setting it, then retry your `pg_restore`.
Let us know if you need more help.
Status changed to Awaiting User Response Railway • 19 days ago
Status changed to Solved sam-a • 19 days ago
sam-a
Hey! The error you're seeing is a shared memory (SHM) limit issue, not a disk space issue. Railway defaults to 64MB of SHM, which isn't enough for heavy operations like refreshing materialized views during a restore.To fix this, add the `RAILWAY_SHM_SIZE_BYTES` environment variable to your Postgres service and set it to something like `524288000` (500MB). If that's still not enough, you can bump it higher (e.g. `1073741824` for 1GB). Redeploy after setting it, then retry your `pg_restore`.Let us know if you need more help.
18 days ago
that's solved it, thank you!
Status changed to Awaiting Railway Response Railway • 18 days ago
Status changed to Solved sam-a • 18 days ago