{"action":"created","issue":{"url":"https://api.github.com/repos/brianc/node-postgres/issues/715","labels_url":"https://api.github.com/repos/brianc/node-postgres/issues/715/labels{/name}","comments_url":"https://api.github.com/repos/brianc/node-postgres/issues/715/comments","events_url":"https://api.github.com/repos/brianc/node-postgres/issues/715/events","html_url":"https://github.com/brianc/node-postgres/issues/715","id":54427427,"number":715,"title":"Can't get standalone client to connect","user":{"login":"maximski","id":1580455,"avatar_url":"https://avatars.githubusercontent.com/u/1580455?v=3","gravatar_id":"","url":"https://api.github.com/users/maximski","html_url":"https://github.com/maximski","followers_url":"https://api.github.com/users/maximski/followers","following_url":"https://api.github.com/users/maximski/following{/other_user}","gists_url":"https://api.github.com/users/maximski/gists{/gist_id}","starred_url":"https://api.github.com/users/maximski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maximski/subscriptions","organizations_url":"https://api.github.com/users/maximski/orgs","repos_url":"https://api.github.com/users/maximski/repos","events_url":"https://api.github.com/users/maximski/events{/privacy}","received_events_url":"https://api.github.com/users/maximski/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-01-15T09:19:37Z","updated_at":"2015-04-07T01:08:29Z","closed_at":"2015-04-07T01:08:29Z","body":"I can't get a client connect to my pg database (like described here: https://github.com/brianc/node-postgres/wiki/Client#tcp-example). The following is the complete code of my testfile: \r\n\r\n```javascript\r\npg = require('pg');\r\nglobal.config = require(\"./config\");\r\nvar client = new pg.Client(conString);\r\n\r\nvar client = new pg.Client({\r\n    user: config.pg_user,\r\n    password: config.pg_pass,\r\n    database: config.pg_db,\r\n    host: config.pg_host,\r\n});\r\n\r\nclient.connect(function(err) {\r\n    if(err) {\r\n        console.error('could not connect to postgres', err);\r\n      }\r\n});\r\n```\r\n\r\nThe error message is plainly \"[Error: Connection terminated]\". Meanwhile it works fine if I just use pg.connect() to create a connected client with the same config. I am working on localhost. Am I missing something?"},"comment":{"url":"https://api.github.com/repos/brianc/node-postgres/issues/comments/90301724","html_url":"https://github.com/brianc/node-postgres/issues/715#issuecomment-90301724","issue_url":"https://api.github.com/repos/brianc/node-postgres/issues/715","id":90301724,"user":{"login":"brianc","id":50081,"avatar_url":"https://avatars.githubusercontent.com/u/50081?v=3","gravatar_id":"","url":"https://api.github.com/users/brianc","html_url":"https://github.com/brianc","followers_url":"https://api.github.com/users/brianc/followers","following_url":"https://api.github.com/users/brianc/following{/other_user}","gists_url":"https://api.github.com/users/brianc/gists{/gist_id}","starred_url":"https://api.github.com/users/brianc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brianc/subscriptions","organizations_url":"https://api.github.com/users/brianc/orgs","repos_url":"https://api.github.com/users/brianc/repos","events_url":"https://api.github.com/users/brianc/events{/privacy}","received_events_url":"https://api.github.com/users/brianc/received_events","type":"User","site_admin":false},"created_at":"2015-04-07T01:08:29Z","updated_at":"2015-04-07T01:08:29Z","body":"Hi @denaje - the final line of your example `client.end()` is ending & disconnecting the client though you've already returned it to the pool. Do __not__ call `client.end()` on a pooled client."}}