Marko Petričević
Marko Petričević

Reputation: 333

pg_dump: too many command-line arguments when calling from cmd

Im trying to make a backup in a folder C:\Users\Marko Petričević\Documents\Radni_sati_Backup\proba where "proba" is the name of backup file.

My command looks like this:

pg_dump -h 192.168.130.240 -p 5433 -U postgres  -F c  postgres > C:\Users\Marko Petričević\Documents\Radni_sati_Backup\proba

and then i get an error: " pg_dump: too many command-line arguments (first is "Petričević\Documents\Radni_sati_Backup\proba") "

But, when I write a command like:

pg_dump -h 192.168.130.240 -p 5433 -U postgres  -F c  postgres >C:\radni_sati_backup\radni_sati_proba

Everything works, and I get that "radni_sati_proba" file in the directory as I listed in command.

Why is this happening?

Upvotes: 0

Views: 4195

Answers (1)

Marko Petričević
Marko Petričević

Reputation: 333

Found out what the problem was:

pg_dump -h 192.168.130.240 -p 5433 -U postgres  -F c  postgres > C:\Users\Marko Petričević\Documents\Radni_sati_Backup\proba

needs to be like this:

pg_dump -h 192.168.130.240 -p 5433 -U postgres  -F c  postgres > "C:\Users\Marko Petričević\Documents\Radni_sati_Backup\proba"

Problem was the space in path.

Upvotes: 1

Related Questions