title: Automatically dropping PostgreSQL tables once per day
body: <p>I have a scenario where I have a central server and a node. Both server and node are capable of running PostgreSQL but the storage space on the node is limited. The node collects data at a high speed and writes the data to its local DB.
  The server needs to replicate the data from the node. I plan on accomplishing this with <a href="http://slony.info/" rel="nofollow">Slony-I</a> or <a href="http://bucardo.org/wiki/Bucardo" rel="nofollow">Bucardo</a>.
  The node needs to be able to delete all records from its tables at a set interval in order to minimize disk space used. Should I use <a href="http://www.pgadmin.org/docs/1.4/pgagent.html" rel="nofollow">pgAgent</a> with a job consisting of a script like </p>
  
  <pre><code>DELETE FROM tablex, tabley, tablez;
  </code></pre>
  
  <p>where the actual batch file to run the script would be something like</p>
  
  <pre><code>@echo off
  C:\Progra~1\PostgreSQL\9.1\bin\psql -d database -h localhost -p 5432 -U postgres -f C:\deleteFrom.sql
  </code></pre>
  
  <p>?</p>
  
  <p>I'm just looking for opinions if this is the best way to accomplish this task or if anyone knows of a more efficient way to pull data from a remote DB and clear that remote DB to save space on the remote node. Thanks for your time.</p>