title: postgres copy command, binary file
body: <p>I am using COPY to copy a field from a table to a file. this field is a zipped text file, so I use a binary copy.
  the file is created, the only problem is that COPY adds a header and a trailer (?) to the file, which I don't need. can this be changed? is there a parameter that can cause COPY to put the field exactly as it is in the database?</p>
  
  <p>If I manually delete the unwanted header I can extract the file with zcat, or gunzip.</p>
  
  <p>I am doing somthing like this:</p>
  
  <pre><code>psql -d some_database -c \
   "copy  (select some_column from a_table where id=900) to stdout with BINARY;" &gt; /tmp/tmp.gz
  </code></pre>
  
  <p>And then I want to do</p>
  
  <pre><code>gunzip /tmp/tmp.gz
  </code></pre>
  
  <p>Any ideas?</p>