1

I want to download dumped PostgreSQL databases from an Ubuntu 16.04 server.

sudo su - postgres
pg_dump my_db > backup_db

Search for the path yields the following:

ps auxw |  grep postgres | grep -- -D
postgres  7311  0.0  0.0 293332  3384 ?        S    Mai04   0:39 /usr/lib/postgresql/9.5/bin/postgres -D /var/lib/postgresql/9.5/main -c config_file=/etc/postgresql/9.5/main/postgresql.conf

Yet I cannot find the dumped files there. What is the location of the dumped files?

1 Answer 1

1

$HOME of user postgres

pg_dump just echoes to stdout, unless you specify -f

-f file --file=file

Send output to the specified file. This parameter can be omitted for file based output formats, in which case the standard output is used. It must be given for the directory output format however, where it specifies the target directory instead of a file. In this case the directory is created by pg_dump and must not exist before.

(formatting mine)

so in your case file backup_db will be in same directory where you were running pg_dump my_db > backup_db

next time try specifying full path to know exact location

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.