title: Transferring database between two servers by piping
body: <p>My older Postgresql servers accepts remote connections.</p>
  
  <p>I'm trying to transfer the database from the old server to a new one. On the new server when logged in as root, I execute the following command</p>
  
  <pre><code>pg_dump -h oldserverip -U mydb -C mydb | psql -h localhost -d mydb -U mydb
  </code></pre>
  
  <p>I then get prompted with the following</p>
  
  <p>"Password for user mydb: Password: "</p>
  
  <p>Why is it asking for password twice?</p>
  
  <p>and after I input the password, it waits there and nothing happens.</p>
  
  <p>Any idea what the problem is?</p>