I used command

pg_dump -C -h remotehost -U remoteuser db_name | psql localhost -U localuser

to copy database on remote server to my local machine.

Can I somehow retreive the dump obtained after the first part of the command, i.e.

pg_dump -C -h remotehost -U remoteuser db_name 

is executed? Can it be stored in some temporary location?


The first command does not store the created file anywhere, so the answer is: no, you can't retrieve that file because there is none.

If you need such a file, you can either re-run the first statement and provide a filename using the -f switch.

Or, if f you have not yet changed your local database, then you can simply dump that.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.