title: Postgres - testing database connection in bash
body: <p>I wonder if there is an alternative to the psql command to test the connection to a postgresql database using bash.</p>
  
  <p>I'm setting up a Core OS cluster and have a side service which should perform the equivalent of <code>psql 'host=xxx port=xxx dbname=xxx user=xxx'</code> every minute to determine if the service is running, and more important, if one can connect to it using the given parameters). </p>
  
  <p>I cannot install postgres directly on Core OS. The command usually used in Core OS is something like <code>curl -f ${COREOS_PUBLIC_IPV4}:%i;</code>. But it tells only if the service itself is running on the given port, without any access check.</p>
  
  <p>Thank you in advance!</p>