title: Remote trigger a postgres database backup
body: <p>I would like to backup my production database before and after running a database migration from my deploy server (not the database server)  I've got a Postgresql 8.4 server sitting on a CentOS 5 machine.  The website accessing the database is on a Windows 2008 server running an MVC.Net application, it checks out changes in the source code, compiles the project, runs any DB Changes, then deploys to IIS.</p>
  
  <p>I have the DB server set up to do a crontab job backup for daily backups, but I also want a way of calling a backup from the deploy server during the deploy process.  From what I can figure out, there isn't a way to tell the database from a client connection to back itself up. If I call pg_dump from the web server as part of the deploy script it will create the backup on the web server (not desirable).  I've looked at the COPY command, and it probably won't give me what I want.  MS SQLServer lets you call the BACKUP command from within a DB Connection which will put the backups on the database machine.</p>
  
  <p>I found this post about MySQL, and that it's not a supported feature in MySQL.  Is Postgres the same?  <a href="https://stackoverflow.com/questions/3631508/remote-backup-of-mysql-database">Remote backup of MySQL database</a></p>
  
  <p>What would be the best way to accomplish this?  I thought about creating a small application that makes an SSH connection to the DB Server, then calls pg_dump?  This would mean I'm storing SSH connection information on the server, which I'd really rather not do if possible.</p>