{"action":"created","issue":{"url":"https://api.github.com/repos/brianc/node-postgres/issues/839","labels_url":"https://api.github.com/repos/brianc/node-postgres/issues/839/labels{/name}","comments_url":"https://api.github.com/repos/brianc/node-postgres/issues/839/comments","events_url":"https://api.github.com/repos/brianc/node-postgres/issues/839/events","html_url":"https://github.com/brianc/node-postgres/issues/839","id":101947774,"number":839,"title":"Named Parameters - now supported in PostGres v9.2+","user":{"login":"nfloersch","id":4584739,"avatar_url":"https://avatars.githubusercontent.com/u/4584739?v=3","gravatar_id":"","url":"https://api.github.com/users/nfloersch","html_url":"https://github.com/nfloersch","followers_url":"https://api.github.com/users/nfloersch/followers","following_url":"https://api.github.com/users/nfloersch/following{/other_user}","gists_url":"https://api.github.com/users/nfloersch/gists{/gist_id}","starred_url":"https://api.github.com/users/nfloersch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nfloersch/subscriptions","organizations_url":"https://api.github.com/users/nfloersch/orgs","repos_url":"https://api.github.com/users/nfloersch/repos","events_url":"https://api.github.com/users/nfloersch/events{/privacy}","received_events_url":"https://api.github.com/users/nfloersch/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-19T17:07:25Z","updated_at":"2015-08-19T21:42:22Z","closed_at":null,"body":"It seems that node-postgres does still not support named parameters in queries. I realize that this was a problem a few years ago because PostGres itself did not support such a thing. But it does now. I would prefer to not have to use a different library/tool that extends node-postgres just to have better access to this functionality. Thanks!"},"comment":{"url":"https://api.github.com/repos/brianc/node-postgres/issues/comments/132797096","html_url":"https://github.com/brianc/node-postgres/issues/839#issuecomment-132797096","issue_url":"https://api.github.com/repos/brianc/node-postgres/issues/839","id":132797096,"user":{"login":"sehrope","id":1690926,"avatar_url":"https://avatars.githubusercontent.com/u/1690926?v=3","gravatar_id":"","url":"https://api.github.com/users/sehrope","html_url":"https://github.com/sehrope","followers_url":"https://api.github.com/users/sehrope/followers","following_url":"https://api.github.com/users/sehrope/following{/other_user}","gists_url":"https://api.github.com/users/sehrope/gists{/gist_id}","starred_url":"https://api.github.com/users/sehrope/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sehrope/subscriptions","organizations_url":"https://api.github.com/users/sehrope/orgs","repos_url":"https://api.github.com/users/sehrope/repos","events_url":"https://api.github.com/users/sehrope/events{/privacy}","received_events_url":"https://api.github.com/users/sehrope/received_events","type":"User","site_admin":false},"created_at":"2015-08-19T21:42:22Z","updated_at":"2015-08-19T21:42:22Z","body":"PostgreSQL doesn't support named parameters. It only supports positional parameters (`$1`, `$2`, ...etc) though you can reference the same parameter more than once. Ex: `SELECT * FROM foo WHERE bar = $1 AND baz = $1`\r\n\r\nThere's a couple of npm modules that wrap node-postgres to provide named parameter support listed as \"Extras\" on the [README](https://github.com/brianc/node-postgres#extras). Check out [pg-db](https://github.com/sehrope/node-pg-db) (I wrote it). It handles auto-returning connections to the pool, transactions, as well as named parameters. See [here](https://github.com/sehrope/node-pg-db#named-parameters) for some examples of using it with named parameters."}}