title: RPostgreSQL connections are expired as soon as they are initiated with doParallel clusterEvalQ
body: <p>I'm trying to setup a parallel task where each worker will need to make database queries.  I'm trying to setup each worker with a connection as seen in <a href="https://stackoverflow.com/questions/3902796/foreach-dopar-rpostgresql">this question</a> but each time I try it returns <code>&lt;Expired PostgreSQLConnection:(2781,0)&gt;</code> for however many workers I registered.</p>
  
  <p>Here's my code:</p>
  
  <pre><code>cl &lt;- makeCluster(detectCores())
  registerDoParallel(cl)
  
  clusterEvalQ(cl, {
    library(RPostgreSQL)
    drv&lt;-dbDriver("PostgreSQL")
    con&lt;-dbConnect(drv, user="user", password="password", dbname="ISO",host="localhost")
  
  })
  </code></pre>
  
  <p>If I try to run my <code>foreach</code> despite the error, it fails with <code>task 1 failed - "expired PostgreSQLConnection"</code></p>
  
  <p>When I go into the postgres server status it shows all the active sessions that were created.</p>
  
  <p>I don't have any problems interacting with postgres from my main R instance.  </p>
  
  <p>If I run</p>
  
  <pre><code>clusterEvalQ(cl, {
    library(RPostgreSQL)
    drv&lt;-dbDriver("PostgreSQL")
    con&lt;-dbConnect(drv, user="user", password="password", dbname="ISO",host="localhost")
    dbGetQuery(con, "select inet_client_port()")
  
  })
  </code></pre>
  
  <p>then it will return all the client ports.  It doesn't give me the expired notice but if I try to run my foreach command it will fail with the same error.</p>
  
  <p>Edit:</p>
  
  <p>I've tried this on Ubuntu and 2 windows computers, they all give the same error.</p>
  
  <p>Another Edit:</p>
  
  <p>Now 3 windows computers</p>