where does pg_dumpall store *.bak file? I want to dump a database. and I use:

pg_dumpall


by using this code, data which has been stored on data base is scrolling in the terminal and it says:

PostgreSQL database dump complete

PostgreSQL database cluster dump complete

but I can not find any new .bak file any where. I also used:

pg_dumpall -f test


it goes to next line without showing any message.

finally, where is stored .bak file?!
There is no .bak file until you name it so.

With the last command in your question, the dump is written to the file test &mdash; this, then, is your &ldquo;.bak file&rdquo;.

In fact, it is an SQL script, because pg_dumpall only supports the plain text format.

You restore such a dump by feeding it to psql:

psql -h hostname -p 1234 -f test -d postgres -U postgres


Where &ldquo;1234&rdquo; is the port number of your new database cluster.