Pg_dump with error: "FATAL: role" username "does not exist"

I have a db with a name backupdb, I want to import it into my local rails application, so I want to take it.

When I start pg_dump backupdb, I get below the error.

pg_dump: [archiver (db)] could not connect to the backupdb database: FATAL: the username role does not exist

what is wrong here. Please, help.

I downloaded db from my email and then tried to dump to import it into local rails application

+5
source share
4 answers

try this maybe this will work for you

$ pg_dump -h localhost -U postgres -Fc mydb > db.dump
+5
source

" " username, . , (postgres, , ).
--username=postgres --password, postgres. ( ​​, pg_hba.conf, --password .

+1

pg_dump -h localhost -U "dbuser" "dbname" -Fc > "pathfilename.backup"

**ex:** pg_dump -h localhost -U mani manidb - Fc > "thamesdb.backup"

pg_dump this answer

0
source

If someone has the same problem using intellij, here is what helped me: In my case, the problem was that I right-clicked on the data source, but you have to open it and right-click on the database itself . Therefore, in the image below do not click on localDB. Right-click the database name, and then dump.

Hope this helps someone solve this confusing UX issue: D

enter image description here

0
source

All Articles