Quantcast
Channel: Question and Answer » postgresql
Viewing all articles
Browse latest Browse all 1138

script for restore of postgres database localy from dump given on stdin – ambiguous redirect

$
0
0

Runing this command:

sshpass -p "pass" ssh x@1.2.3.4 "pg_dump -U foo some_db"

runs perfectly fine. It returns on stdandard output the dump of db.

Then I would like to restore new_db based on dump redirected to stdin

 psql -U foo -d new_db < `sshpass  -p "pass" ssh  x@1.2.3.4 "pg_dump -U foo some_db"`

I got error: ambiguous redirect


Viewing all articles
Browse latest Browse all 1138

Trending Articles