sequelize/sequelize — pull request #860 by durango (2013-08-27 19:36:15+00:00)
Title: Fix: Postgres connection issues

## Fixes PostgresSQL connection problems.

This commit fixes the following connection problems:
* Pools should now properly release themselves always
* You can now set a "TestOnBorrow"-like functionality with
config.pool.reapInterval).
* Heroku should be able to properly send the correct DB credentials.

## Postgres single connections will no longer leak

Some users were experiencing problems with Postgres connections leaking when
they didn't enable pooling. This commit should fix the problem.

- In prototype.disconnect() we now properly call this.client.end with
this.client.end.bind(this.client) (as shown in the node-postgres wiki).
- We no longer check for readyForQuery on this.client as that value may not
always be populated by node-postgres (possibly a bug on node-postgres).

This should close https://github.com/sequelize/sequelize/issues/859