I have a db named backupdb
, I want to import this to my local rails app so I want to take a dump of it.
When I am running pg_dump backupdb
, I am getting below error.
pg_dump: [archiver (db)] connection to database "backupdb" failed: FATAL: role "username" does not exist
what's wrong here. Please help.
I downloaded the db from my email and then trying to create a dump so I can import it to my local rails app
Try this way, it works!!
$ pg_dump -h localhost -U postgres -Fc mydb > db.dump
This command will take the backup of complete database
pg_dump -h localhost -U "dbuser" "dbname" -Fc > "pathfilename.backup"
**ex:** pg_dump -h localhost -U mani manidb - Fc > "thamesdb.backup"
for more pg_dump formats please refer to this answer
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With