title: connection pool exhausted psycopg2
body: <p>I have an issue with Postgresql psycopg2.
  I receive the error  :</p>
  
  <blockquote>
    <p>error in executing with exception:  connection pool exhausted</p>
  </blockquote>
  
  <p>My code :</p>
  
  <pre><code>from psycopg2 import pool
  import pandas.io.sql as sqlio
  import pandas as pd
  db = pool.ThreadedConnectionPool(5, 100,host=POSTGRES['host'],
  database=POSTGRES['database'],user=POSTGRES['username'],
  password=POSTGRES['password'],port=POSTGRES['port'])
  
  
  try:
      sql = "select * from role"  
      data = sqlio.read_sql_query(sql, db.getconn())
      return data.to_json(orient='records')
  except Exception as e:
      print "error in executing with exception: ", e
      return pd.DataFrame({'empty' : []})
  </code></pre>
  
  <p>and this request should return only 5 rows, but i get this error.</p>
  
  <p>Do you have any idea why i get this error ?</p>
  
  <p>My Postgresql Database (medium instance) is deployed on a public cloud.</p>
  
  <p>Thank you in advance</p>