title: Check that connection is valid
body: <p>I'm using <code>RPostgreSQL</code> and <code>sqldf</code> inside my function like this:</p>
  
  <pre><code>MyFunction &lt;- function(Connection) {
  
      options(sqldf.RPostgreSQL.user      = Connection[1], 
              sqldf.RPostgreSQL.password  = Connection[2],
              sqldf.RPostgreSQL.dbname    = Connection[3],
              sqldf.RPostgreSQL.host      = Connection[4], 
              sqldf.RPostgreSQL.port      = Connection[5])
  
      # ... some sqldf() stuff
  }
  </code></pre>
  
  <p>How do I test that connection is valid?</p>