Need help backing up a database in enterprisedb. The pg_dumpall command doesn't work. When I run the command, it says can't connect to the database. I connect to the database and run the command, it doesn't give any errors, but the file doesn't show up in the location I saved it.
Asked
Active
Viewed 41 times
0
-
You'll have to give `pg_dumpall` the correct options so that it can connect to the database. – Laurenz Albe Mar 08 '18 at 13:09
-
$ pg_dumpall > db.out this is the using dumpall command. By the way your database is in local or server? – aemre Mar 08 '18 at 13:14
1 Answers
0
Try using pg_dumpall -d dbname -f outputfile
.
Or if your database is in a different server, use pg_dumpall -h hostname -p port -U username -d dbname -f outputfile

Lohit Gupta
- 1,045
- 6
- 11
-
-
If you are not using `postgres` user to connect, you have to specify dbname. As it creates a database process internally to dump the contents. – Lohit Gupta Sep 16 '20 at 00:10