title: How to download Postgres bytea column as file
body: <p>Currently, i have a number of files stored in postgres 8.4 as bytea. The file types are .doc, .odt, .pdf, .txt and etc.</p>
  
  <p>May i know how to download all the file stored in Postgres because i need to to do a backup.
  I need them in their original file type instead of bytea format.</p>
  
  <p>Thanks!</p>