Q:

Postgresql-9.6 backup

I have to backup a PostgreSQL database using this command:
sudo pg_dumpall -a mydb > app111618.bak 
After I type that command, I get this error:
`pg_dumpall: too many command-line arguments (first is "mydb")`

In the command it say this:

Try pg_dumpall --help for more information. 

How can I fix this? 

A:

pg_dumpall is a tool to dump all databases, so it doesn't support specifying a database name (assuming that mydb is the name of the database you want to dump). 
If you want to dump only a single database, use pg_dump instead:
pg_dump -a mydb > app111618.bak

If you did intend to dump all databases, just leave out the database name:
pg_dumpall -a > app111618.bak

