title: Call a PostgreSQL function in bash script
body: <p>How can I call a PostgreSQL function in a bash script :</p>
  
  <pre><code>#!/bin/bash
  psql -U usr -d db1
  select firstfunction();
  EXIT;
  EOF
  </code></pre>
  
  <p>This connects me to my database in the command line (Putty), but it doesn't run the function. When I exit with (\q) I get an error "syntax error near unexpected token exit"</p>