As of version 1.0 of node-postgres, the pg.connect callback now returns a 'done' callback which one needs to use to return the client object to the connection pool.
var pg = require('pg');
function pgConnect (callback) {
pg.connect('tcp://nodepg:password@localhost/pgstore',
function (err, client, done) {
if (err) {
console.log(JSON.stringify(err));
}
if (client) {
callback(client);
done();
}
}
);
};
As of version 1.0 of node-postgres, the pg.connect callback now returns a 'done' callback which one needs to use to return the client object to the connection pool.