Unable to import postgresql dump to my fly-db-app

Hello, everybody!

I am now trying to migrate my postgresql db from Heroku to fly.io.
I downloaded a dump of my db from Heroku.
Then, I set up a private network connection with WireGuard.
And after this, I am trying to import Heroku dump to fly.io db with this command:

pg_restore -v -d fly_io_db_uri < heroku_dump

However, for every table occurs the following error:

pg_restore: error: could not execute query: ERROR: cannot execute ALTER TABLE in a read-only transaction

As a result, I have all my tables created. But they are all empty.

I suppose it is a problem with db. But my SQL skills are not enough to solve this on my own.

Hope someone can help :pray: