title: PostgreSQL Copy to FTP Server
body: <p>we can use </p>
  
  <pre><code>copy (select * from mytbl) to 'D:/products.csv' with csv header 
  </code></pre>
  
  <p>to import <code>data</code> in <code>mytbl</code> to <code>local disk D</code></p>
  
  <p>so is it possible to use the same method to upload the file directly into a <code>FTP-Server</code> ?</p>
  
  <p>i tried like this</p>
  
  <pre><code>copy (select * from mytbl) to 'ftp://usrname:mypasswrd@ftp.drivehq.com/masters/3/product/products.csv' with csv header 
  </code></pre>
  
  <p>but got this <code>error</code></p>
  
  <pre><code>ERROR: relative path not allowed for COPY to file
  SQL state: 42602
  </code></pre>
  
  <p>using <code>PostgreSQL 9.2</code></p>