HEROKU transfer pg_restore error could not execute query ERROR role b1ahbl4h does not exist

Following the instructions from the Postgres Backup and Restore guide (https://blog.railway.app/p/postgre-backup). Neither the general nor Heroku-specific instructions were working for me. I keep getting the same error 37 times:
pg_restore: while PROCESSING TOC:
pg_restore: from TOC entry 201; 1259 26716 TABLE active_storage_attachments bjgcpazvgytpjw
pg_restore: error: could not execute query: ERROR: role "bjgcpazvgytpjw" does not exist
Command was: ALTER TABLE public.active_storage_attachments OWNER TO bjgcpazvgytpjw;

pg_restore: from TOC entry 202; 1259 26731 SEQUENCE active_storage_attachments_id_seq bjgcpazvgytpjw
pg_restore: error: could not execute query: ERROR: role "bjgcpazvgytpjw" does not exist
Command was: ALTER TABLE public.active_storage_attachments_id_seq OWNER TO bjgcpazvgytpjw;

pg_restore: from TOC entry 203; 1259 26736 TABLE active_storage_blobs bjgcpazvgytpjw
pg_restore: error: could not execute query: ERROR: role "bjgcpazvgytpjw" does not exist
Command was: ALTER TABLE public.active_storage_blobs OWNER TO bjgcpazvgytpjw;
...
pg_restore: while PROCESSING TOC:
pg_restore: from TOC entry 201; 1259 26716 TABLE active_storage_attachments bjgcpazvgytpjw
pg_restore: error: could not execute query: ERROR: role "bjgcpazvgytpjw" does not exist
Command was: ALTER TABLE public.active_storage_attachments OWNER TO bjgcpazvgytpjw;

pg_restore: from TOC entry 202; 1259 26731 SEQUENCE active_storage_attachments_id_seq bjgcpazvgytpjw
pg_restore: error: could not execute query: ERROR: role "bjgcpazvgytpjw" does not exist
Command was: ALTER TABLE public.active_storage_attachments_id_seq OWNER TO bjgcpazvgytpjw;

pg_restore: from TOC entry 203; 1259 26736 TABLE active_storage_blobs bjgcpazvgytpjw
pg_restore: error: could not execute query: ERROR: role "bjgcpazvgytpjw" does not exist
Command was: ALTER TABLE public.active_storage_blobs OWNER TO bjgcpazvgytpjw;
...
The article section on pg_restore specific to Heroku (https://blog.railway.app/p/postgre-backup#heroku-specific-instructions) doesn't seem to actually differ from the general pg_restore method. Could the issue be that the article is missing the --no-owner flag? To test, I ran this: pg_restore -U postgres -h containers-us-west-##.railway.app -p 7180 -W -F t --no-owner -d railway latest.dump And it worked. Is this correct? If so, should the article be updated?
Railway Blog
How to Backup and Restore Your Postgres Database
In this post, we will go over the process of backing up and restoring your Postgres database hosted on Railway.
3 Replies
angelo
angelo2y ago
I think so, I will add this to the guide. I think its a timescale thing Thanks for flagging!!!
chiperific
chiperific2y ago
Glad I could help!
Unknown User
Unknown User17mo ago
Message Not Public
Sign In & Join Server To View