title: PostgreSQL version in connection string
body: <p>I have two versions of postgresql installed, 9.4 and 9.5. I am using npm's <a href="https://www.npmjs.com/package/pg" rel="nofollow">pg</a> to connect to the server using a postgres connection string. From CLI, I can connect to 9.5 by using the <code>--cluter</code> option like so: <code>psql --cluster 9.5/main</code>. In postgres' <a href="http://www.postgresql.org/docs/9.4/static/libpq-connect.html#LIBPQ-PARAMKEYWORDS" rel="nofollow">documentation for the connection string</a>, they show one of the querystring parameters you can use is <code>options</code>:</p>
  
  <blockquote>
    <p><code>options</code> - Adds command-line options to send to the server at run-time</p>
  </blockquote>
  
  <p>I realize this means configuration parameters for the server, not the client. Nonetheless, I tried constructing the connection string and including the cluster option to connect to 9.5:</p>
  
  <p><code>postgres://user@localhost/db_name?options=--cluster%3D9.5%2Fmain</code></p>
  
  <p>And sure enough I get: <code>psql: FATAL:  unrecognized configuration parameter "cluster"</code></p>
  
  <p>Okay, no surprise there. However, I can't seem to connect to 9.5 no matter what I do. I even have the environment variable <code>PGCLUSTER</code> set to the appropriate version string, however I think this is only read from CLI (ie: not when the server is connected to via unix socket or host).</p>
  
  <p>What is the easiest way to connect to the 9.5 server instead of 9.4 from a script connecting to the server via <code>localhost</code>? </p>