{"action":"created","issue":{"url":"https://api.github.com/repos/brianc/node-postgres/issues/726","labels_url":"https://api.github.com/repos/brianc/node-postgres/issues/726/labels{/name}","comments_url":"https://api.github.com/repos/brianc/node-postgres/issues/726/comments","events_url":"https://api.github.com/repos/brianc/node-postgres/issues/726/events","html_url":"https://github.com/brianc/node-postgres/issues/726","id":57311262,"number":726,"title":"Node Postgres Module not responding","user":{"login":"whoisstan","id":150920,"avatar_url":"https://avatars.githubusercontent.com/u/150920?v=3","gravatar_id":"","url":"https://api.github.com/users/whoisstan","html_url":"https://github.com/whoisstan","followers_url":"https://api.github.com/users/whoisstan/followers","following_url":"https://api.github.com/users/whoisstan/following{/other_user}","gists_url":"https://api.github.com/users/whoisstan/gists{/gist_id}","starred_url":"https://api.github.com/users/whoisstan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/whoisstan/subscriptions","organizations_url":"https://api.github.com/users/whoisstan/orgs","repos_url":"https://api.github.com/users/whoisstan/repos","events_url":"https://api.github.com/users/whoisstan/events{/privacy}","received_events_url":"https://api.github.com/users/whoisstan/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-02-11T12:44:22Z","updated_at":"2015-02-11T15:04:06Z","closed_at":"2015-02-11T15:04:06Z","body":"I have an amazon beanstalk node app that uses the postgres amazon RDS. To interface node with postgres I use node postgres. Code looks like this:\r\n\r\n```javascript\r\n  var   pg      = require('pg'),\r\n        done,client;      \r\n\r\n  function DataObject(config,success,error) {\r\n\r\n    var PG_CONNECT =  \"postgres://\"+config.username+\":\"+config.password+\"@\"+\r\n                    config.server+\":\"+config.port+\"/\"+config.database;\r\n    self=this;\r\n    pg.connect(PG_CONNECT, function(_error, client, done) {\r\n      if(_error){ error();}\r\n      else\r\n      {\r\n        self.client = client;\r\n        self.done = done;\r\n        success();\r\n      }\r\n    });\r\n  }\r\n\r\n  DataObject.prototype.add_data = function(data,success,error) {\r\n    self=this;\r\n    this.client.query('INSERT INTO sample (data) VALUES ($1,$2)',\r\n      [data], function(_error, result) {\r\n          self.done();\r\n          success();\r\n    });\r\n  };\r\n\r\n```\r\nTo use it I create my data object and then call add_data every time new data comes along. Within add_data I call 'this/self.done()' to release the connection back to the pool. Now when I repeatedly make those requests the client.query never gets back. Under what circumstance could this lead to a blocking/not responding database interface?"},"comment":{"url":"https://api.github.com/repos/brianc/node-postgres/issues/comments/73895282","html_url":"https://github.com/brianc/node-postgres/issues/726#issuecomment-73895282","issue_url":"https://api.github.com/repos/brianc/node-postgres/issues/726","id":73895282,"user":{"login":"whoisstan","id":150920,"avatar_url":"https://avatars.githubusercontent.com/u/150920?v=3","gravatar_id":"","url":"https://api.github.com/users/whoisstan","html_url":"https://github.com/whoisstan","followers_url":"https://api.github.com/users/whoisstan/followers","following_url":"https://api.github.com/users/whoisstan/following{/other_user}","gists_url":"https://api.github.com/users/whoisstan/gists{/gist_id}","starred_url":"https://api.github.com/users/whoisstan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/whoisstan/subscriptions","organizations_url":"https://api.github.com/users/whoisstan/orgs","repos_url":"https://api.github.com/users/whoisstan/repos","events_url":"https://api.github.com/users/whoisstan/events{/privacy}","received_events_url":"https://api.github.com/users/whoisstan/received_events","type":"User","site_admin":false},"created_at":"2015-02-11T15:04:06Z","updated_at":"2015-02-11T15:04:06Z","body":"Solved. I was under the wrong impression that the client was the pool and every time I query I simply request a new connection. "}}