title: pg_dump postgres database from remote server when port 5432 is blocked
body: <p>I'm trying to pg_dump a SQL database on a remote server in our DMZ. There are 2 problems.</p>
  <ol>
  <li><p>there is not a lot of space left on the remote server so the normal command run to locally backup the database
  <code>pg_dump -C database &gt; sqldatabase.sql.bak</code>  won't work due to space issues.</p>
  </li>
  <li><p>I also can't run the other version of pg_dump command to dump database from remote server to local server using:</p>
  <p>pg_dump -C -h remotehost -U remoteuser db_name | psql localhost -U localuser db_name</p>
  </li>
  </ol>
  <p>as the server is in our DMZ and port 5432 is blocked. What I'm looking to see is if it is possible to pg_dump the database and immediatly save it (ssh or some other form) as a file to a remote server.
  What I was trying was:   <code>pg_dump -C testdb | ssh admin@ourserver.com | &gt; /home/admin/testdb.sql.bak</code></p>
  <p>Does anyone know if what i am trying to achieve is possible?</p>